Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _00._TEST
- {
- class Program
- {
- static void Main(string[] args)
- {
- int kozunatsi = int.Parse(Console.ReadLine());
- int totalSugar = 0;
- int totalFloor = 0;
- int maxFlour = int.MinValue;
- int maxSugar = int.MinValue;
- for (int i = 1; i <= kozunatsi; i++)
- {
- int sugar = int.Parse(Console.ReadLine());
- int floor = int.Parse(Console.ReadLine());
- totalFloor += floor;
- totalSugar += sugar;
- if (floor > maxFlour)
- {
- maxFlour = floor;
- }
- if (sugar > maxSugar)
- {
- maxSugar = sugar;
- }
- }
- double a = Math.Ceiling(totalSugar / 950.0);
- double b = Math.Ceiling(totalFloor / 750.0);
- Console.WriteLine($"Sugar: {a}");
- Console.WriteLine($"Flour: {b}");
- Console.WriteLine($"Max used flour is {maxFlour} grams, max used sugar is {maxSugar} grams.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement