#include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<= N){ return false; } if(wlim == W[n]){ //成功 return true; } else if(wlim < W[n]){ //失敗 dp[n][wlim] = 0; return false; } if(dp[n][wlim] != -1){ //cout << "dp"; if( dp[n][wlim] == 0){ return false; }else{ return true; } } { ans = solve(n+1,wlim -W[n]); if(ans == true){ return ans; } ans = solve(n+1,wlim ); if(ans == true){ return ans; } } dp[n][wlim] = 0; return false; } int main(void){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed;// //cout << setprecision(6);// cin>>N;//[2,100] int sum=0; rep(i,N){ cin>>W[i];//[1,100] sum += W[i]; } if(sum%2 != 0){ P("impossible"); return 0; } sort(W,W+N); rep(i,N){ rep(k,10001){ dp[i][k] = -1; } } bool ans = solve(0,sum/2); if(ans == true){ P("possible"); }else{ P("impossible"); } return 0; }