#include using namespace std; #define fastcin {\ cin.tie(0);\ ios::sync_with_stdio(false);\ } #define scan(x) cin >> x #define print(x) cout << x << "\n" int main() { fastcin; int n, i, j; scan(n); int sum = 0, w[n]; for (i = 0; i < n; ++i) { scan(w[i]); sum += w[i]; } if ((sum & 0x01)) { } else { int half = sum/2; bool dp[n+1][half+1]; for (i = 0; i < n+1; ++i) for (j = 0; j < half+1; ++j) dp[i][j] = false; dp[0][0] = true; for (i = 0; i < n; ++i) { for (j = 0; j < half+1; ++j) { dp[i+1][j] |= dp[i][j]; if (j+w[i] <= half) dp[i+1][j+w[i]] |= dp[i][j]; } if (dp[n][half]) { print("possible"); return 0; } } } print("impossible"); return 0; }