All submissions for this problem are available.
Two bike riders A and B want to compete with each other. They wanted to have a race to prove who is best and the destination point is 180 km away from their starting point.
A challenged B that he would start from 20km away from the starting point and he would reach the destination point X minutes before B finishes up the race.
As race begin..
B travels first 1/3 of the distance with a speed of 75.25 km/hr , next 1/2 of the remaining distance with 80.73 km/hr and remaining distance with veocity v ( user defined)
A travels first 1/4 of the distance with a speed of 75.25 km/hr , next 1/3 of the remaining distance with 80.73 km/hr.
Since RIder A is poor in maths and busy in racing.. he seeks your help to make a program which outputs the min velocity with which he has to move the remaining distance so as to win the competition just in time.
Assume that both are moving with a constant velocity.
- First line of input contains a single integer T, the number of test cases.
- Each test starts with a single line having X, the time in which A has to finish up the race (in minutes).
- Next line contain velocity V, with which rider B has to move.
- For each test case , output a line containg velocity V with which Rider A has to move inorder to win. The answer will be accepted if it is round off to2 decimal points.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.