![]() |
||||||||||
|
||||||||||
Identify the numberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 461 Accepted Submission(s): 160 Problem Description Taly likes to take photographs. Because he is interested in geometry and graphics. One day, he went to a museum which exhibits all kinds of things of Mars people. He is surprised that the Mars people use the arabic numberals as human beings. But they only use the number from 0 to 8 and they like to write the numbers in a skew style as the gure sees. Then Taly took many photographs of the number writing (in fact,it is forbidden to take photograph in the so mystical museum). When home, he transformed these photograph into the graph on a 2 - D plane. Taly is confused that how to identify the numbers automatically. Now Taly ask help to you to write a program to identify the numbers. ![]() Input For each test case, the first line is the number n which indicates the number of the segments. Then n lines follow, each line has four float numbers which are x1, y1, x2, y2 with precision up to 6 decimal places. (x1, y1), (x2, y2) are the two endpoints of the segment. Each segment has the same length 1 and one segment connects at least another one. For any line which is paralleled with y-axis and has width of 5, it won't cross more than one number. It means that the minimum absolute dierence of two number's x coordinate is at least 5. 2 ≤ n ≤ 1000, -10000 ≤ x1, y1, x2, y2 ≤ 10000. Output For each test case, output the numbers from left to right as the sample sees. Sample Input
Sample Output
Source | ||||||||||
|