#include #include #include #include #include using namespace std; int main() { int n; cin >> n; vector w(n); for (int i=0;i> w[i]; sort(w.begin(), w.end(), greater()); int t = 0; int th; for (int a : w ) t += a; if (t%2!=0) { cout << "impossible" << endl; return 0; } th = t/2; int ws = w[0]; if (ws==th) {cout << "possible" << endl; return 0;} stack s; for (int i=1;ith) { while (!s.empty()) { int a = s.top();s.pop(); ws = ws - a; } ws = ws -m; break;} else if (ws==th) {cout << "possible" << endl; return 0;} else {ws = ws + w[j]; s.push(j);} } } cout << "impossible" << endl; return 0; } /*95 56 56 54 29 24 12 4 0 1 2 3 4 5 6 7*/