F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Dog and dog

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 446    Accepted Submission(s): 122


Problem 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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 10:40:46, Gzip enabled