[Solution] Insurance CodeChef Solution 2022 | Solution Codechef
Problem
Chef bought car insurance. The policy of the insurance is:
- The maximum rebatable amount for any damage is Rs lakhs.
- If the amount required for repairing the damage is lakhs, that amount is rebated in full.
Chef's car meets an accident and required Rs lakhs for repairing.
Determine the amount that will be rebated by the insurance company.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- The first and only line of each test case contains two space-separated integers and .
Output Format
For each test case, output the amount (in lakhs) that will be rebated by the insurance company.
Explanation:
Test case : The damages require only Rs lakh which is below the upper cap, so the entire Rs lakh will be rebated.
Test case : The damages require Rs lakh which is above the upper cap, so only Rs lakh will be rebated.
Test case : The damages require only Rs lakh which is equal to the upper cap, so the whole Rs lakh will be rebated.
Test case : The damages require Rs lakh which is above the upper cap, so only Rs lakh will be rebated.
No comments:
Post a Comment