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 _03ListsMoreExcercisesCamelBack
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> camel = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- int n = int.Parse(Console.ReadLine());
- int difference = camel.Count - n;
- if(difference<=0)
- {
- Console.WriteLine("already stable: {0}",string.Join(" ",camel));
- }
- else
- {
- Console.WriteLine("{0} rounds {1}remaining: {2}",difference/ 2,Environment.NewLine,string.Join(" ",camel.GetRange(difference/2,n)));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment