编程介的小学生 2017-08-28 14:34 采纳率: 20.5%
浏览 550
已采纳

Advanture of Xiaoxingxing

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

  • 写回答

1条回答

  • threenewbee 2017-09-12 15:54
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 易语言把MYSQL数据库中的数据添加至组合框
  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况