Chef organised a 3030 kilometres marathon in Chefland.The participants receive medals on completing the marathon as following:If the total time taken is less than 33 hours, they receive a GOLD medal.If the total time taken is greater than equal to 33 hours but less than 66 hours, they receive a SILVER medal.If the total time taken is greater than equal to 66 hours, they receive a BRONZE medal.Chefina participated in the marathon and completed it in ๐X hours. Which medal would she receive?Input FormatThe input consists of a single integer ๐X โ the number of hours Chefina took to complete the marathon.Output FormatOutput the medal Chefina would recieve.Note that you may print each character in uppercase or lowercase. For example, the strings GOLD, gold, Gold, and gOlD are considered the same.Constraints1โค๐โค101โคXโค10.Sample 1:InputOutput2GOLDExplanation:Chefina completed the marathon in less than 33 hours. Thus, she gets a GOLD medal.Sample 2:InputOutput5SILVERExplanation:Chefina took more than 33 but less than 66 hours. Thus, she gets a SILVER medal.Sample 3:InputOutput6BRONZEExplanation:Chefina took 66 hours to complete the marathon. Thus, she gets a BRONZE medal.
Question
Chef organised a 3030 kilometres marathon in Chefland.The participants receive medals on completing the marathon as following:If the total time taken is less than 33 hours, they receive a GOLD medal.If the total time taken is greater than equal to 33 hours but less than 66 hours, they receive a SILVER medal.If the total time taken is greater than equal to 66 hours, they receive a BRONZE medal.Chefina participated in the marathon and completed it in ๐X hours. Which medal would she receive?Input FormatThe input consists of a single integer ๐X โ the number of hours Chefina took to complete the marathon.Output FormatOutput the medal Chefina would recieve.Note that you may print each character in uppercase or lowercase. For example, the strings GOLD, gold, Gold, and gOlD are considered the same.Constraints1โค๐โค101โคXโค10.Sample 1:InputOutput2GOLDExplanation:Chefina completed the marathon in less than 33 hours. Thus, she gets a GOLD medal.Sample 2:InputOutput5SILVERExplanation:Chefina took more than 33 but less than 66 hours. Thus, she gets a SILVER medal.Sample 3:InputOutput6BRONZEExplanation:Chefina took 66 hours to complete the marathon. Thus, she gets a BRONZE medal.
Solution
The problem is asking to determine which medal Chefina would receive based on the number of hours she took to complete a marathon.
Here are the steps to solve this problem:
Similar Questions
Olympics 2024Athletes of Chefland have won ๐บG gold medals, ๐S silver medals, and ๐ตB bronze medals in the Paris Olympics.Chef will be happy only if the Chefland team wins 55 medals of each type. Find the total number of additional medals the team needs to win to make Chef happy.Input FormatThe first and only line of input will contain three space-separated integers ๐บ,๐,G,S, and ๐ตB โ the number of gold, silver, and bronze medals, respectively.Output FormatFor each test case, output on a new line, the total number of additional medals the team needs to win to make Chef happy.Constraints1โค๐บ,๐,๐ตโค51โคG,S,Bโค5Sample 1:InputOutput5 1 45
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 has finally decided to complete all of his pending assignments.There are ๐X assignments where each assignment takes ๐Y minutes to complete.Find whether Chef would be able to complete all the assignments in ๐Z days.Input FormatThe first line of input will contain a single integer ๐T, denoting the number of test cases.Each test case consists three space-separated integers ๐,๐,X,Y, and ๐Z โ the number of assignments, time taken in minutes to complete each assignment, and the number of days in which Chef wants to complete the assignments.Output FormatFor each test case, output on a new line, YES, if Chef would be able to complete all the assignments in ๐Z days. 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โค๐โค1051โคTโค10 5 1โค๐,๐โค1001โคX,Yโค1001โค๐โค101โคZโค10Sample 1:InputOutput35 5 550 80 220 72 1YESNOYESExplanation:Test case 11: Chef needs a total of 5โ 5=255โ 5=25 minutes to complete all the assignments. Thus, he would be able to complete the assignments in 55 days.Test case 22: Chef needs a total of 50โ 80=400050โ 80=4000 minutes to complete all the assignments. However, in 22 days, he only has 2โ 24โ 60=28802โ 24โ 60=2880 minutes.Thus, he would not be able to complete the assignments in 22 days.Test case 33: Chef needs a total of 20โ 72=144020โ 72=1440 minutes to complete all the assignments. In 11 days, he has 24โ 60=144024โ 60=1440 minutes.Thus, he would be able to complete the assignments in 11 day.
On the occasion of Yoga Day, the only yoga instructor in Chefland, Chef, has received numerous queries.Chef has managed to free up ๐N hours from his busy schedule to conduct yoga sessions. There are two types of sessions that Chef offers:Type 11 session, which lasts 11 hour, and earns Chef ๐X rupees.Type 22 session, which lasts 22 hours, and earns Chef ๐ย (๐>๐)Yย (Y>X) rupees.Find the maximum amount of money Chef can earn in ๐N hours.Input FormatThe first line of input will contain a single integer ๐T, denoting the number of test cases.Each test case consists of three space-separated integers ๐,๐,๐N,X,Y โ the number of hours for which Chef will take yoga sessions, price of type 11 session, and price of type 22 session respectively.Output FormatFor each test case, output on a new line, the maximum amount of money Chef can earn in ๐N hours.Constraints1โค๐โค10001โคTโค10001โค๐โค10001โคNโค10001โค๐<๐โค1001โคX<Yโค100Sample 1:InputOutput34 5 73 1 25 2 620314Explanation:Test case 11: Chef will take type 11 sessions for all 44 hours. Thus, in 44 hours, he can take 44 sessions earning a total of 4โ 5=204โ 5=20 rupees.Test case 22: Chef will take one session of type 11 and one session of type 22. Thus, in 33 hours, he earns a total of 1โ 1+1โ 2=31โ 1+1โ 2=3 rupees.Test case 33: Chef will take one session of type 11 and two sessions of type 22. Thus, in 55 hours, he earns a total of 1โ 2+2โ 6=141โ 2+2โ 6=14 rupees.
Chef wants to run at least 10001000 meters to reach his fitness goal.There's a rectangular park nearby, with a length of ๐X meters and a width of ๐Y meters.Can Chef complete his goal by running one loop around the park? (Loop meaning running the entire path around the edge of the park.)Input FormatThe only line of input will contain 22 space-separated integers ๐X and ๐Y, the length and the width of the rectangular park.Output FormatPrint "YES" if Chef will be able to complete his fitness goal, otherwise print "NO" (without quotes).You may print each character of the output in either uppercase or lowercase (for example, the strings YES, yEs, yes, and yeS will all be treated as identical).Constraints1โค๐,๐โค10001โคX,Yโค1000Sample 1:InputOutput400 100YESExplanation:The perimeter of the ground is (400+100+400+100)=1000๐(400+100+400+100)=1000m which is sufficient to complete Chef's morning run.Sample 2:InputOutput300 150NOExplanation:The perimeter of the ground is (300+150+300+150)=900๐(300+150+300+150)=900m which is not sufficient to complete Chef's morning run.
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.