Knowee
Questions
Features
Study Tools

Chef was driving on a highway at a speed of 𝑋X km/hour.To avoid accidents, there are fine imposed on overspeeding as follows:No fine if the speed of the car ≤70≤70 km/hour.Rs 500500 fine if the speed of the car is strictly greater than 7070 and ≤100≤100.Rs 20002000 fine if the speed of the car is strictly greater than 100100.Determine the fine Chef needs to pay.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of a single integer 𝑋X denoting the speed of Chef's car.Output FormatFor each test case, output the fine paid by Chef.Constraints1≤𝑇≤2001≤T≤2001≤𝑋≤2001≤X≤200Sample 1:InputOutput74011070100691018502000050002000500Explanation:Test case 11: The speed is ≤70≤70. Thus, Chef does not need to pay any fine.Test case 22: The speed is greater than 100100. Thus, Chef needs to pay 20002000 as fine.Test case 33: The speed is ≤70≤70. Thus, Chef does not need to pay any fine.Test case 44: The speed is greater than 7070 and ≤100≤100. Thus, Chef needs to pay 500500 as fine amount.Test case 55: The speed is ≤70≤70. Thus, Chef does not need to pay any fine.Test case 66: The speed is greater than 100100. Thus, Chef needs to pay 20002000 as fine.Test case 77: The speed is greater than 7070 and ≤100≤100. Thus, Chef needs to pay 500500 as fine amount.

Question

Chef was driving on a highway at a speed of 𝑋X km/hour.To avoid accidents, there are fine imposed on overspeeding as follows:No fine if the speed of the car ≤70≤70 km/hour.Rs 500500 fine if the speed of the car is strictly greater than 7070 and ≤100≤100.Rs 20002000 fine if the speed of the car is strictly greater than 100100.Determine the fine Chef needs to pay.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of a single integer 𝑋X denoting the speed of Chef's car.Output FormatFor each test case, output the fine paid by Chef.Constraints1≤𝑇≤2001≤T≤2001≤𝑋≤2001≤X≤200Sample 1:InputOutput74011070100691018502000050002000500Explanation:Test case 11: The speed is ≤70≤70. Thus, Chef does not need to pay any fine.Test case 22: The speed is greater than 100100. Thus, Chef needs to pay 20002000 as fine.Test case 33: The speed is ≤70≤70. Thus, Chef does not need to pay any fine.Test case 44: The speed is greater than 7070 and ≤100≤100. Thus, Chef needs to pay 500500 as fine amount.Test case 55: The speed is ≤70≤70. Thus, Chef does not need to pay any fine.Test case 66: The speed is greater than 100100. Thus, Chef needs to pay 20002000 as fine.Test case 77: The speed is greater than 7070 and ≤100≤100. Thus, Chef needs to pay 500500 as fine amount.

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The problem is asking to determine the fine that Chef needs to pay based on his speed. The rules for the fines are as follows:

  1. No fine if the

Similar Questions

Long DriveChef and Chefina are out on a long road trip.The average speed of the car after 1010 hours of driving is 𝑋X kilometres per hour.Chef wants to achieve an average speed of 𝑌Y kilometres per hour. Given that he can travel a maximum of 100100 kilometres in one hour, find the minimum number of additional integer hours required for him to reach the target average speed.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of two space-separated integers 𝑋X and 𝑌Y — the average speed after 1010 hours of driving and the required average speed.Output FormatFor each test case, output on a new line, the minimum number of integer hours required for him to reach the target average speed.Constraints1≤𝑇≤12251≤T≤122550≤𝑋<𝑌<10050≤X<Y<100Sample 1:InputOutput350 5160 8055 9511080Explanation:Test case 11: The average speed after 1010 hours is 5050 kmph. This means that Chef has travelled a distance of 50⋅10=50050⋅10=500 kilometres. If he covers 6161 kilometres in the next hour, his average speed would be (500+61)(10+1)=51(10+1)(500+61)​ =51. Thus, he can achieve the target average speed in one hour.Test case 22: The average speed after 1010 hours is 6060 kmph. This means that Chef has travelled a distance of 60⋅10=60060⋅10=600 kilometres. If he covers 100100 kilometres each for the next 1010 hours, his average speed would be (600+100⋅10)(10+10)=80(10+10)(600+100⋅10)​ =80. Thus, he can achieve the target average speed in minimum of 1010 hours.

Chef had collected 𝑁N notes of Rs. 20002000 to pay his total college fees. However, the government banned Rs. 20002000 notes.Chef wants to pay the same amount using Rs. 500500 notes only. Find the number of notes Chef needs.Input FormatEach test case consists of a single integer 𝑁N - the number of notes of Rs. 20002000 that Chef has collected.Output FormatOutput a single integer - the number of Rs. 500500 notes needed.Constraints1≤𝑁≤1001≤N≤100Sample 1:InputOutput416Explanation:44 notes of Rs. 20002000 make a total of 4⋅2000=80004⋅2000=8000 rupees. This is equivalent to 1616 notes of Rs. 500500.

Alice is going for a drive. During her drive, she reached a maximum speed of 𝑆S km/hr.As per the rules of the government, the speed of the vehicle must not exceed 4040 km/hr, otherwise the person will be fined.You need to tell whether Alice will be fined or not.Input FormatThe only line of input will contain a single integer 𝑆S - denoting the maximum speed Alice reached while driving.Output FormatPrint YES if Alice will be fined , otherwise print NO.You may print each character of the string in uppercase or lowercase (for example, the strings YES, yEs, yes, and yeS will all be treated as identical).Constraints1≤𝑆≤501≤S≤50Sample 1:InputOutput40NOExplanation:Since Alice's speed does not exceed 4040, she will not be fined.Sample 2:InputOutput41YESExplanation:Since Alice's speed exceeds 4040, she will be fined.

Chef and his girlfriend went on a date. Chef took 𝑋X dollars with him, and was quite sure that this would be enough to pay the bill. At the end, the waiter brought a bill of 𝑌Y dollars. Print "YES" if Chef has enough money to pay the bill, or "NO" if he has to borrow from his girlfriend and leave a bad impression on her.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of a single line of input, containing two space-separated integers 𝑋X and 𝑌Y.Output FormatFor each test case, output on a new line "YES" if Chef has enough money to pay the bill and "NO" otherwise.You may print each character of the string in either uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).Constraints1≤𝑇≤1001≤T≤1001≤𝑋,𝑌≤1001≤X,Y≤100Sample 1:InputOutput41 11 22 150 100YESNOYESNOExplanation:Test case 11: Since the money Chef has is equal to the bill, he will be able to pay the bill.Test case 22: Since the money Chef has is less than the bill, he will have to borrow from his girlfriend and leave a bad impression on her.Test case 33: Since the money Chef has is greater than the bill, he will be able to pay the bill.Test case 44: Since the money Chef has is less than the bill, he will have to borrow from his girlfriend and leave a bad impression on her.

Four friends want to attend a concert. Each ticket costs 𝑋X rupees.They have decided to go to the concert if and only if the total cost of the tickets does not exceed 10001000 rupees.Determine whether they will be going to the concert or not.Input FormatThe first line of input will contain a single integer 𝑇T, denoting the number of test cases.Each test case consists of a single integer 𝑋X, the cost of each ticket.Output FormatFor each test case, output YES if they will be going to the concert, NO otherwise.You can print each character in uppercase or lowercase. For example, the strings YES, yes, Yes, and yES, are all considered identical.Constraints1≤𝑇≤1001≤T≤1001≤𝑋≤10001≤X≤1000Sample 1:InputOutput41005002501000YESNOYESNOExplanation:Test case 11: The total cost of all tickets is 100⋅4=400100⋅4=400 which is ≤1000≤1000. Thus, they will go to the concert.Test case 22: The total cost of all tickets is 500⋅4=2000500⋅4=2000 which is >1000>1000. Thus, they will not go to the concert.Test case 33: The total cost of all tickets is 250⋅4=1000250⋅4=1000 which is ≤1000≤1000. Thus, they will go to the concert.Test case 44: The total cost of all tickets is 1000⋅4=40001000⋅4=4000 which is >1000>1000. Thus, they will not go to the concert.

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.