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 PreparingForExams
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> beehives = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- List<int> hornets = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- int sum = 0;
- List<int> aliveBees = new List<int>();
- for(int i = 0; i< hornets.Count; i++)
- {
- sum += hornets[i];
- }
- for(int i =0; i < beehives.Count;i++)
- {
- if (sum > beehives[i])
- {
- beehives.Remove(beehives[i]);
- Console.WriteLine(string.Join(" ", beehives));
- }
- if (sum < beehives[i])
- {
- aliveBees[i] = beehives[i] - sum;
- sum = sum - hornets[0];
- hornets.Remove(0);
- Console.WriteLine(sum);
- Console.WriteLine(string.Join(" ", aliveBees));
- }
- }
- //Console.WriteLine(sum);
- //Console.WriteLine(string.Join(" ", aliveBees));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment