using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OmoriToTenbin { class Program { public const int MaxOmoriWait = 100; static bool IsPossible(int HalfData, int Number, string[] Data, bool[] OmoriFlag) { for (int a = 0; a < Data.Length; a++) { OmoriFlag[int.Parse(Data[a])] = true; } // for (int c = 0; c < Data.Length; c++){ for (int a = 0; a < Data.Length; a++) { for (int b = OmoriFlag.Length - 1; b >= 0; b--) { if (OmoriFlag[b] == true) { if ((b + int.Parse(Data[a])) < (Number * MaxOmoriWait)) { // if (b != int.Parse(Data[a])) // { OmoriFlag[b + int.Parse(Data[a])] = true; //} } } } // } } if (OmoriFlag[HalfData]) { return true; } else { return false; } } static int CreateHalf(string[] Data) { int half = 0; for (int a = 0; a < Data.Length; a++) { half += int.Parse(Data[a]); } if ((half % 2) != 0) { return 0; } return half / 2; } static void Main(string[] args) { int Number; Number = int.Parse(Console.ReadLine()); //標準入力 string[] Data = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得 /* Number = 7; string[] Data = { "20", "47", "73", "69", "26", "62", "89" }; */ bool[] OmoriFlag = new bool[Number * MaxOmoriWait]; int HalfData = CreateHalf(Data); if (HalfData == 0) { Console.WriteLine("impossible\n"); return; } if (IsPossible(HalfData, Number, Data, OmoriFlag)) { Console.WriteLine("possible\n"); } else { Console.WriteLine("impossible\n"); } } } }