[Solution] TV Discount CodeChef Solution
Problem
Chef is looking to buy a TV and has shortlisted two models. The first one costs rupees, while the second one costs rupees.
Since there is a huge sale coming up on Chefzon, Chef can get a flat discount of rupees on the first TV, and a flat discount of rupees on the second one.
Help Chef determine which of the two TVs would be cheaper to buy during the sale.
Input Format
- The first line contains a single integer — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains four space-separated integers , , and — the marked price (in rupees) of the first TV, the marked price (in rupees) of the second TV, the flat discount (in rupees) of the first TV, and the flat discount (in rupees) of the second TV.
Output Format
For each test case, print a single line containing the string First
if the first TV is cheaper to buy with discount, or Second
if the second TV is cheaper to buy with discount. If both of them cost the same after discount, print Any
.
You may print each character of the string in uppercase or lowercase (for example, the strings first
, First
, fIRSt
, and FIRST
will all be treated as identical).
Explanation:
Test case : The cost of the first TV after discount is , while the cost of the second TV after discount is . Thus the first TV is cheaper to buy than the second.
Test case : The cost of the first TV after discount is , while the cost of the second TV after discount is . Thus the second TV is cheaper to buy than the first.
Test case : The cost of the first TV after discount is , while the cost of the second TV after discount is . Since they are equal, Chef can buy any of them.
No comments:
Post a Comment