#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair PII; typedef pair PLL; #define fs first #define sc second #define INF 1000000000 #define MOD 1000000007 #define EPS 0.00000001 int main() { int N; cin >> N; vector W(N); int s = 0; for(int &w:W){ cin >> w; s += w; } int x = s/2; if(x*2!=s){ cout << "impossible" << endl; return 0; } vector> dp(N+1, vector(10001)); dp[0][0] = 1; for(int i=0; i=0) dp[i+1][j] = dp[i][j] | dp[i][j-W[i+1]]; else dp[i+1][j] = dp[i][j]; } } if(dp[N][x]) cout << "possible" << endl; else cout << "impossible" << endl; return 0; }