#include #include #include #include #include using namespace std; #define REP(i,first,last) for (int i=first;i w_list; int dp[101][10001] = {}; bool solve(int idx, int total){ if (dp[idx][total] == 1) { return false; } else if (dp[idx][total] == 2) { return true; } if (idx >= N || total > half) { dp[idx][total] = 1; return false; } int new_total = total + w_list[idx]; if (new_total == half) { dp[idx][total] = 2; return true; } if (solve(idx + 1, new_total) || solve(idx + 1, total)) { dp[idx][total] = 2; return true; } dp[idx][total] = 1; return false; } int main(){ cin >> N; int val; int total = 0; REP(i,0,N){ cin >> val; w_list.push_back(val); total += val; } sort(w_list.begin(), w_list.end()); if (total & 1) { cout<<"impossible"<> 1; if (solve(0, 0)) { cout<<"possible"<