码迷,mamicode.com
首页 > 其他好文 > 详细

ural 1341. Device

时间:2015-11-26 23:22:23      阅读:339      评论:0      收藏:0      [点我收藏+]

标签:

1341. Device

Time limit: 1.0 second
Memory limit: 64 MB
Major (M): You claimed that your device would be able to fly round the Earth several times and to miss not more than a couple of centimeters?
Designer (D); Yes! Our gravitational fields system of navigation absolutely...
M: Furthermore it can’t be fixed by detectors and doesn’t have a receiver or transmitter.
Engineer (E): It was your demand that nobody could detect the device...
M: We gave it a simple task to fly round the square. It didn’t return to the initial point.
D: Was that square large?
M: It’s none of your business! This is the State secret! You are to find the device!
Programmer (P): How did you programme the mission profile?
M: The device was to fly one conditional length unit to the North, the same distance to the East, the same distance to the South and then to the West. It passed more than 40 minutes since the device was to return. If they find it before us!.. In short, you are to find it!
D: It’s understood. Where was the initial point?
(The major flags and in two seconds the designer lies on the floor with his hands tied and two gunpoints look at his nape).
M: Why do you need this information?
E: You misunderstood! We don’t need information! But if we knew the initial point coordinates we could say where the device was...
(In two seconds two gunpoints look at the engineer’ nape, too).
M: Who interests this information? Where is the device? One, two, ...
P: You can’t understand! If the device reached the North Pole it can’t continue not to the North. Not to the East. Only to the South! Where the device is depends on where it started.
(Major aims at the programmer.)
M: No, it didn’t reach the Pole. It was taken into account.
P: Let me write a program that would count the final coordinates of the device. You’ll input the latitude, the longitude and the value of your conditional length unit yourself! The program would give you the answer keeping the absolute secrecy.
M: I’ll give you a chance. You three have got a computer and five hours... Less than five hours already. If we do not get the coordinates... You’ll suffer first.

Input

The first line contains the initial latitude W. –90 < W < 90. The second line – the initial longitude L, -180 < L ≤ 180. The third line contains the length of the square side, which the device was to fly round. The length is given in kilometers. The device keeps the fixed distance 6400 km from the Earth center of mass. The South Pole has latitude –90, the North Pole – latitude 90. The East direction is counted off the 0th meridian in the positive direction.

Output

You should output the final latitude and longitude of the device within three digits after a decimal point.

Sample

inputoutput
56.846841
53.36673
1124.427
56.847
60.631
Problem Author: Stanislav Vasilyev
Problem Source: USU Championship 2004

ural 1341. Device

标签:

原文地址:http://www.cnblogs.com/StupidBoy/p/4999148.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!