#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(x,y) for(int x = 0;x < (y);x++) #define LLI long long int #define FORR(x,arr) for(auto& x:arr) #define ALL(a) (a.begin()),(a.end()) #define _L(x) cout<<(x)< class UF { public: vector _parent,_rank; UF() { _parent=_rank=vector(um,0); for(int i=0;i_rank[yRoot]) { _parent[xRoot] = yRoot; return yRoot; } if(_rank[xRoot]<_rank[yRoot]) { _parent[yRoot] = xRoot; return xRoot; } if(xRoot != yRoot) { _parent[yRoot] = xRoot; _rank[xRoot]++; return xRoot; } return xRoot; } }; bool dp[10001]; vector w; int N; int main() { cin >> N; w.resize(N); int sum = 0; FOR(i, 10001) { dp[i] = false; } dp[0] = true; FOR(i, N) { cin >> w[i]; sum += w[i]; } if(sum % 2 == 1) { cout << "impossible" << endl; return 0; } int half = sum / 2; FOR(i, N) { for(int j = sum - w[i];j >= 0;j--) { dp[w[i] + j] |= dp[j]; } } if(dp[half]) { cout << "possible" << endl; return 0; } cout << "impossible" << endl; return 0; }