Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Problem2
- {
- class Problem2
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- ulong counterSlapped = 0;
- ulong counterEscaped = 0;
- ulong totalSlapped = 0;
- ulong sumBeers = 0;
- for (int i = 0; i < n; i++)
- {
- ulong thieves = ulong.Parse(Console.ReadLine());
- ulong beers = ulong.Parse(Console.ReadLine());
- while (counterSlapped < 5 && thieves > 0)
- {
- counterSlapped++;
- thieves--;
- }
- counterEscaped += thieves;
- sumBeers += beers;
- totalSlapped += counterSlapped;
- counterSlapped = 0;
- }
- ulong bottleBeers = sumBeers % 6;
- ulong packBeers = sumBeers / 6;
- Console.WriteLine("{0} thieves slapped.",totalSlapped);
- Console.WriteLine("{0} thieves escaped.", counterEscaped);
- Console.WriteLine("{0} packs, {1} bottles.", packBeers,bottleBeers);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement