Submit | All submissions | Best solutions | Back to list |
S2P3 - Two Face on the high way |
Heath is driving his car to Miami. Heath reached a point where he was confused and couldn't decide which road he should take. Lucky heath his friend Hary was with him who decided to help Heath
Hary : How many gallons of gas left in your tank ?
Heath : why ?
Hary : Beacuse depending on how much remaining I will decide which road we should take.
If the number of gallons greater then 50 then Hary will ask about the length of the 2 roads (in Km)
(known that each gallon can go as far as 1.5 KM ) Choose the road which the car can go through with
the current amount of gas. If both roads can be crossed choose the shortest one.
any other case you should decide to turn back and take neither of the two roads.
Output A if road 1 is chosen
Output B if road 2 is chosen
Output X otherwise
Input
G .. number of gallons (Integer) , 0<G<10,000
R1 .. length of road number 1 (Float), R1 >0.0
R2 .. length of road number 2 (Float), R2 >0.0
Output
One line with either A or B or X
Example
Input: 60 90 100 Output: A
Input:
30
Output:
X
Added by: | mohamed gamal |
Date: | 2012-01-27 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ASM32-GCC MAWK BC C-CLANG NCSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JS-MONKEY JULIA KTLN NIM NODEJS OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 PY_NBC R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET |