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

Advanture of Xiaoxingxing

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 404    Accepted Submission(s): 52


Problem Description
Fat Xiaoxingxing was so fat that he couldn't walk with his feet. But he didn't care about it. "Sphere is also a shape of body." He always said and somehow he was a bit happy with that.

The only thing he cared was his Lost Piece (LP). He was born with some imperfection. He felt depressed with that. Not does he become complete until he could find his LP. "I will find my LP." As he declared, he set off for his LP. He couldn't walk, so he could only move by rolling. He had to bear the hard sunshine or the heavy rain. However, he still sang songs on his way, "La... la... la... I am going to find my LP..." After a long journey of adventure, he found where his LP lay. It was not far away from him.

Now given the positions of Xiaoxingxing and his LP, you are asked to calculate the minimum degree he needed to roll to reach his LP.
 

Input
There are multiple test cases. The first line contains an integer n (0 < n ¡Ü 100). The body of Xiaoxingxing can be decribed as a polygon of n points. Each of the following n lines contains two integers xi and yi (|xi| ¡Ü 10000, 0 ¡Ü yi ¡Ü 10000) , descibing a point of the polygon clockwise or counter-clockwise. The first point of the polygon is always the origin and the polygon will not be self-crossed. The last line of each test case contains two integers X and Y (xi < X ¡Ü 10000, 0 ¡Ü Y ¡Ü 10000), descrbing the position of the Lost Piece. Xiaoxingxing can only roll with some point fixed on the ground where y = 0.
 

Output
For each test case, first output one line containing "Case x:" where x is the case number (starting from 1). If it is possible for Xiaoxingxing to reach his LP, output the minimum angel in degrees he has to roll before he can reach his LP. The result should be accurate up to 2 decimal places. Otherwise, output "Impossible" instead.
 

Sample Input
4 0 0 0 1 -1 1 -1 0 1 0 4 0 0 0 3 -4 3 -4 0 3 6
 

Sample Output
Case 1: 90.00 Case 2: Impossible
 

Author
GUAN, Yao
 

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-24 19:35:10, Gzip enabled