Dog and dog

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

Description

Nowadays, Xiaoyang thinks of a simple problem. The problem is derive from primary school: Two men get close with the same speed v1, there is a dog run between them with speed v2. It is easy to answer the question that how long dog has run (D) before they meet. Since it is so easy, he want to change this problem. Two men can see each other within 10 meters, if their distance less than 10 meters, then they stop. The dog can run at most L2 meters. At first, two man's distance is L1 meters, their speeds are changed. The left man's speed becomes and the right man's speed becomes . The dog's speed also changed to

Input

the first line N, then N lines follows
each line has 4 parameters L1, L2, V1, V2;

0<=L1,L2<=100,0<v1,v2<=100

Output

D represent how long dog has run, round to integer.

Sample Input

2
9 1 2 3 
47 11 25 9

Sample Output

0
11

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .