[Solution] Car Trip CodeChef Solution | Solution CodeChef
Problem
Chef rented a car for a day.
Usually, the cost of the car is Rs per km. However, since Chef has booked the car for the whole day, he needs to pay for at least kms even if the car runs less than kms.
If the car ran kms, determine the cost Chef needs to pay.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of a single integer - denoting the number of kms Chef travelled.
Output Format
For each test case, output the cost Chef needs to pay.
Explanation:
Test case : The car runs for kms. Thus, he needs to pay rupees.
Test case : The car runs for kms. However, since Chef booked the car for whole day, he needs to pay for at least kms. Thus, he needs to pay rupees.
Test case : The car runs for kms. However, since Chef booked the car for whole day, he needs to pay for at least kms. Thus, he needs to pay rupees.
Test case : The car runs for kms. Thus, he needs to pay rupees.
Test case : The car runs for kms. Thus, he needs to pay rupees.
No comments:
Post a Comment