#include #include #include using namespace std; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } vectorvec; vector>dp; int avg; int N; int dfs(int i, int now) { if (dp[i][now] != -1) return dp[i][now]; if (i == 0) { if (now == 0) return 1; return 0; } int res = 0; int n = vec[i-1]; if (now >= n && dfs(i-1, now-n) == 1) res = 1; if (dfs(i-1, now) == 1) res = 1; return dp[i][now] = res; } int main() { cin >> N; vec.resize(N); int sum = 0; for (int i=0; i> vec.at(i); sum += vec[i]; } avg = sum/2; dp.assign(N+1, vector(avg+1, -1)); if (sum % 2 != 0) { cout << "impossible" << endl; } else { if (dfs(N, avg) == 1) { cout << "possible" << endl; } else { cout << "impossible" << endl; } } return 0; }