Gifts delivery

시간 제한2초메모리 제한1024 MB

요약
가드가 (p,q)에서 위로 v1 속도로 지나가는 직사각형 트럭을 피해 v2 이하의 속도로 움직이며 자리를 비운 시간을 최소화하는 문제다.
난이도

어려움10점 중 8점

유형
기하, 수학, 그리디, 이분 탐색
정답자
아직 제출이 없습니다

문제

A trouble has happened at Taja's work: a truck driver got sick, while there's is an urgency to deliver gifts from one store to another. Fortunately, currently she has a break, and this store is situated on the same street so her skill to drive only forward with constant speed v_1v\_1 is quite sufficient, to help the situation.

But one of the crossroads on the way to the store has broken traffic lights, and now there is traffic guard, who is not supposed to leave his place.

At some moment he noticed the truck moving towards him and having no intention to steer aside. And he's not supposed to move --- he will be penaltized for that --- nevertheless he will have to. That's why traffic guard wants to allow the truck bypass in such a way that he will minimize his time of being off his initial position. Traffic guard can move in any way, but his speed cannot exceed v_2v\_2.

Regard the truck as a rectangle and traffic guard as a dot. It is required that dot should never be strictly inside the rectangle and time, during which the dot isn't at (p,q)(p, q) (its initial position), should be minimal possible.

입력

First line contains 66 integers aa, bb, pp, qq, v_1v\_1, v_2v\_2 (1≤a≤1001 \leq a \leq 100, 0≤b≤990 \leq b \leq 99, −a<p<a-a < p < a, b<q≤100b < q \leq 100, 1≤v_1,v_2≤1001 \leq v\_1, v\_2 \leq 100). Initially upper left corner of the truck is at (−a,b)(-a, b), lower right corner is at (a,0)(a, 0). Traffic guard initially stands at the point (p,q)(p, q). Truck moves towards increasing of the second coordinate with constant speed v_1v\_1. Maximal speed of the traffic guard is v_2v\_2. If b=0b = 0, regard the length of the truck being as small as required.

All distances are measured in meters, speed is measured in meters per second.

It is guaranteed that all the values are such that answer won't exceed 10,00010\\,000.

출력

Output should contain single real number --- the least possible time, when the traffic guard will be absent at (p,q)(p, q) point. Answer should be given with absolute or relative error that doesn't exceed 10−610^{-6}.

힌트

In the first sample it would be optimal to wait for 22 seconds, then move for 33 seconds to the right with maximal speed, and then move backwards-left with maximal speed.

예제2

  1. 예제 1

    입력
    4 0 1 5 1 1
    
    예상 출력
    6
    
  2. 예제 2

    입력
    3 2 -1 10 5 2
    
    예상 출력
    2.306019375