View on Codechef
Chefland has 22 different types of coconut, type AA and type BB. Type AA contains only xaxa milliliters of coconut water and type BB contains only xbxb grams of coconut pulp. Chef’s nutritionist has advised him to consume XaXa milliliters of coconut water and XbXb grams of coconut pulp every week in the summer. Find the total number of coconuts (type AA + type BB) that Chef should buy each week to keep himself active in the hot weather.
For the work from home Internship Programs : Click here to apply now
- The first line contains an integer TT, the number of test cases. Then the test cases follow.
- Each test case contains a single line of input, four integers xaxa, xbxb, XaXa, XbXb.
For each test case, output in a single line the answer to the problem.
- xaxa divides XaXa.
- xbxb divides XbXb.
Subtask #1 (100 points): original constraints
3 100 400 1000 1200 100 450 1000 1350 150 400 1200 1200
13 13 11
TestCase 11: Number of coconuts of Type AA required = 1000100=101000100=10 and number of coconuts of Type BB required = 1200400=31200400=3. So the total number of coconuts required is 10+3=1310+3=13.
TestCase 22: Number of coconuts of Type AA required = 1000100=101000100=10 and number of coconuts of Type BB required = 1350450=31350450=3. So the total number of coconuts required is 10+3=1310+3=13.
TestCase 33: Number of coconuts of Type AA required = 1200150=81200150=8 and number of coconuts of Type BB required = 1200400=31200400=3. So the total number of coconuts required is 8+3=118+3=11.
Due to copyright issues we won't be able to update the solution here immediately. However you can download the code file from our telegram channel. So join our telegram channel for further updates. Keep tracking, the solution will be updated on this website soon.
- HACKEREARTH IS HIRING FOR INTERN || APPLY NOW
- INTEL IS HIRING FOR SOFTWARE DEVELOPER INTERN || APPLY Now
- DATA SCIENCE INTERNSHIP | SONY RESEARCH INDIA || APPLY NOW
- Cognizant Hiring | Graduate Trainee | APPLY NOW
- Deloitte Hiring | QA- Senior Analyst | APPLY NOW
- IBM Hiring | Technical Support Associate | APPLY NOW
- CRED | Freshers Hiring | Backend developer | APPLY NOW
- Axis bank | Internship Opportunity | Young Bankers Program
Read more post Here