Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- namespace SantasCookies
- {
- class Program
- {
- static void Main(string[] args)
- {
- int cup = 140,
- bigSpoon = 20,
- smallSpoon = 10,
- cookiesPerBox = 5,
- singleCookieGrams = 25,
- totalBoxes = 0,
- batches = int.Parse(Console.ReadLine());
- for (int b = 0; b < batches; b++)
- {
- int flour = int.Parse(Console.ReadLine());
- int sugar = int.Parse(Console.ReadLine());
- int cocoa = int.Parse(Console.ReadLine());
- int flourCups = flour / cup,
- sugarSpoons = sugar / bigSpoon,
- cocoaSpoons = cocoa / smallSpoon;
- int boxesOfCookies = (cup + bigSpoon + smallSpoon)
- * new[] { flourCups, sugarSpoons, cocoaSpoons }.Min()
- / singleCookieGrams / cookiesPerBox;
- if (boxesOfCookies == 0)
- {
- Console.WriteLine("Ingredients are not enough for a box of cookies.");
- }
- else
- {
- Console.WriteLine($"Boxes of cookies: {boxesOfCookies}");
- totalBoxes += boxesOfCookies;
- }
- }
- Console.WriteLine($"Total boxes: {totalBoxes}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement