Searching

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 1590
64-bit integer IO format: %I64d      Java class name: Main

Description

"You know what?" Angel said, "There is a love-letter from me embeded on the lawn. And if you can find it, it's for you~"
"How can I find it on such a big lawn?"
"I will show you a hint: start from that tree which is in center of this lawn, and run directly to (X,Y) point. Please memorize the distance you'v passed. Then turn left with a angle A degree, and go ahead for k times of the length you'v passed in the first step. k is a real number from 0 to 1. When you arrive, repeat to turn left, and run for k times as far as the length of the last step. After many many times, you will reach a place, where I embed my letter..."
Of cause, Gardon wouldn't follow her hint simply. He just run there directly. Can you do it?

Input

Input have serveral test cases. Each cases have for real number: X,Y,A,k

Output

For each case, print the place where the treasure is embed.

Sample Input

1 0 90 0.5
1 0 90 0
1 0 0 0.5

Sample Output

(0.800,0.400)
(1.000,0.000)
(2.000,0.000)

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .