Martian Glyphs#421

Martian Glyphs

Hard

The team of Ukrainian researchers led by Kozak Vus has arrived on Mars. Shortly after landing, they discovered traces of an extraterrestrial civilization. They found a bunker secured with two combination locks. To unlock them, they need to correctly decipher the symbolic code drawings inscribed on the wall. Near the bunker, Kozak Vus found a book with example drawings for each digit from to . Unfortunately, the part of the book with examples for the digit was missing. The team knows that the first code does not contain the digit . Help Kozak Vus's team get into the bunker.

You are given an archive 'train.zip' with training data. It consists of 9 folders: the folder named contains examples of symbolic drawings of the digit . Each drawing is stored in a separate txt file.

Input

You are given two test sets in the archives 'test1.zip' and 'test2.zip' — for the first and second subtasks, respectively. They consist of txt files with symbolic drawings of digits.

Output

For each drawing in the test set, determine which digit it represents. For each test set, write all results into a separate file: one digit per line. The result for the -th image must be on the -th line. Note that you must write results for different subtasks into different files. Note that in this problem, you only need to submit the answer file.

Scoring

The final score for the problem is the sum of the maximum scores obtained for each subtask across all your submissions.

  1. (50 points): This subtask contains only drawings of digits from to . Let be the number of digits you identified correctly, and be the total number of digits in the test set. Let a = \frac{c}{t}. Then your score for this subtask (in points) will be:

    • points, if a < 0.1;

    • \frac{(a - 0.1) \cdot 40}{0.85} points, if 0.1 \leq a < 0.95;

    • 40 + \frac{(a - 0.95) \cdot 10}{0.05} points, if a \geq 0.95.

  2. (50 points): This subtask may contain drawings of digits from to . Let be the number of digits you identified correctly, and be the total number of digits in the test set. Let a = \frac{c}{t}. Then your score for this subtask (in points) will be:

    • points, if a < 0.9;

    • \frac{(a - 0.9) \cdot 50}{0.08} points, if 0.9 \leq a < 0.98;

    • points, if a \geq 0.98.