Problem Description Mr. West bought a new car! So he is travelling around the city. One day he comes to a vertical corner. The street he is currently in has a width x, the street he wants to turn to has a width y. The car has a length l and a width d. Can Mr. West go across the corner? |
Input Every line has four real numbers, x, y, l and w. Proceed to the end of file. |
Output If he can go across the corner, print "yes". Print "no" otherwise. |
Sample Input 10 6 13.5 410 6 14.5 4 |
Sample Output yesno |
Idea To begin with, if d is smaller than x or y, then it's sure that the car couldn't pass the conner. Besides, we can considerate the l, which can be composed by a. l = [(x / sin(a) + y / cos(a)) * cos(a) - d / sin(a)] / cos(a) simplify the equality, we can get l = x / sin(a) + y / cos(a) - d / sin (a) / cos(a) then I can get l' and l'', but I can't find the any regulation about those. what's a pity! so I just use trichotomy to get similarity of l. I know it's luck.
|
Code 1 #include
|
Key Points Pay more attention to the algorithm. |