Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Diver
Description Diver had just completed her mission in the depths of the ocean and needs to resurface. To get to the surface she must use the rope that goes straight down from her boat on the surface to her location To avoid decompression sickness diver can descend (go down) or ascend (go up) at most d feet under the water.Each shark swims at its own constant depth of v — swimming away from the rope on distance of _{s}w feet and swimming back to the rope again. Sharks change the direction of their movement so fast, that we consider it being instantaneous. When a shark attacks the diver it also moves so fast, that we consider it to happen instantaneously as soon as the diver is inside a circle of r feet in radius around a shark.Your task is to figure out if the diver can get to the surface without being attacked by a shark, and if yes, then how fast she can do it. Input The first line of the input file contains 6 integer numbers: *d*(10 ≤*d*≤ 100) — initial depth of the diver.*v*(1 ≤_{d}*v*≤ 10) — maximal speed of the diver._{d}*n*(1 ≤*n*≤ 20) — number of sharks.*r*(1 ≤*r*≤ 10) — minimal safe distance between a shark and the diver.*w*(10 ≤*w*≤ 100) — maximal distance that a shark swims away from the rope.*v*(1 ≤_{s}*v*≤ 50) — speed of a shark._{s}
Then follow *d*(1 ≤_{i}*d*<_{i}*d*) — depth of*i*-th shark.*w*(0 ≤_{i}*w*≤_{i}*w*) — initial distance from*i*-th shark to the rope.*f*(_{i}*f*is 1 or −1) — initial direction of_{i}*i*-th shark’s movement in relation to the rope (1 if it swims away from the rope, or −1 if it swims to the rope).
Initially the diver is more than Output Write to the output file Sample Input 10 1 2 1 10 1 6 4 -1 1 1 1 Sample Output 11.414213562373096 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator