using System; using System.Text; using System.Collections.Generic; public class Program { public void Proc() { Reader.IsDebug = false; int omoriCount = int.Parse(Reader.ReadLine()); this.OmoList.AddRange(Reader.GetInt()); int total = 0; foreach (int num in this.OmoList) { total += num; } this.OmoList.Sort(); this.OmoList.Reverse(); bool ans = (total % 2 == 0); if(ans) { ans = CanBalance(0, total / 2); } Console.WriteLine(ans?"possible":"impossible"); } private List OmoList = new List(); Dictionary> dic = new Dictionary>(); private bool CanBalance(int idx, int remain) { if(!dic.ContainsKey(idx)) { dic.Add(idx, new Dictionary()); } if(dic[idx].ContainsKey(remain)) { return dic[idx][remain]; } if(remain == 0) { return true; } if(remain < 0) { return false; } if (idx >= this.OmoList.Count) { return false; } bool ans = false; for (int i=idx; i