Sasta Shark Tank Solution | CodeChef Problem Solution 2022 | April Long Two
Devendra just had a million-dollar idea and he needs funds to startup. He was recently invited to Sasta Shark Tank (A TV show where entrepreneurs pitch their ideas to investors hoping to get investment in return).
He was offered deals from two investors. The first investor offers dollars for % of his company and the second investor offers dollars for % of his company. Devendra will accept the offer from the investor whose valuation of the company is more. Determine which offer will Devendra accept or if both the offers are equally good.
For example, if the first investor offers dollars for % of the company, then the first investor's valuation of the company is dollars since % of . If the second investor offers dollars for % of the company, then the second investor's valuation of the company is dollars since % of .
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 two integers and - the amount offered by first investor for % of Devendra's company and the amount offered by second investor for % of Devendra's company respectively.
Output Format
For each test case, Output FIRST
if Devendra should accept the first investor's deal, output SECOND
if he should accept the second investor's deal, otherwise output ANY
if both deals are equally good.
You may print each character of the strings in uppercase or lowercase (for example, the strings "FiRst", "First", "FIRST", and "FIrst" will all be treated as identical).
Constraints
- and are multiples of
Sample Input 1
3
100 200
200 100
200 500
Sample Output 1
ANY
FIRST
SECOND
Explanation
Test case 1: First investor's valuation of Devendra's company was since % of which is the amount he offered for % of the company.
Second investor's valuation of Devendra's company was also since % of which is the amount he offered for % of the company.
Therefore he can accept any of the deal.
Test case 2: First investor offered a better deal as he valued Devendra's company at dollars (since % of ) compared to the second investor who valued Devendra's company at dollars (since % of ).
Test case 3: Second investor offered a better deal as he valued Devendra's company at dollars compared to the first investor who valued Devendra's company dollars.
Join Now for Solution:-
No comments:
Post a Comment