Run Jerry Run
All submissions for this problem are available.
Tom being angry with Jerry, decided to catch him. Both are standing on x-axis with Tom's current position as (x1,y1) and Jerry is standing at (x2,y2). Jerry understood Tom's intention and prepared himself for the pursuit, he always runs away from tom. Tom knows Jerry is faster than him but this time Tom is determined and chases Jerry.
- The first line of the input contains an integer T denoting the number of test cases.
- Now each test case contains single line having four integral values x1,x2,v1, and v2.Where x1 & x2 are positions of Tom and Jerry respectively. and v1 & v2 are the speeds of Tom and Jerry respectively. The speed is defined as unit distance per unit time.
- A single line denoting whether it is possible for Tom to catch Jerry if possible then output the coordinates at which Tom catches Jerry in integral time and if not possible then output "not possible".
- 1 ≤ T ≤ 100
- -2*10^5 ≤ x1,x2 ≤ 2*10^5
- 0 ≤ v1,v2 ≤ 2*10^5
- y1 = y2 = 0
Input: 3 0 2 2 0 0 4 2 2 0 2 2 1 Output: (2,0) not possible (4,0)
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6|
Fetching successful submissions