F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Identify the number

Time 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 di erence 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
12 -6.000000 2.000000 -6.000000 3.000000 -6.000000 3.000000 -6.000000 4.000000 0.707107 -0.707107 0.000000 0.000000 0.000000 0.000000 0.707107 0.707107 0.707107 0.707107 1.414213 0.000000 1.414213 0.000000 2.121320 0.707107 2.121320 0.707107 1.414213 1.414213 9.707107 -0.707107 9.000000 0.000000 9.000000 0.000000 9.707107 0.707107 9.707107 0.707107 10.414213 0.000000 9.707107 0.707107 10.414213 1.414213 11.121320 0.707107 10.414213 1.414213
 

Sample Output
123
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-29 06:07:16, Gzip enabled