using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("2"); WillReturn.Add("2 4"); //1 1 //1番目の動物が亀、2番目の動物が鶴である } else if (InputPattern == "Input2") { WillReturn.Add("3"); WillReturn.Add("4 4 4"); //3 0 //3匹とも鶴である } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); int[] AArr = InputList[1].Split(' ').Select(X => int.Parse(X)).ToArray(); int S = AArr.Sum() / (AArr.Length - 1); int TuruCnt = 0; int KameCnt = 0; foreach (int EachInt in AArr) { if (S - EachInt == 2) TuruCnt++; else KameCnt++; } Console.WriteLine("{0} {1}", TuruCnt, KameCnt); } }