#include #include #include #include #include #include #include #include //#include #include #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define SWAP(a,b) (a ^= b,b = a ^ b,a ^= b) #define swap(type,a,b) do{type _c;_c=a;a=b;b=_c;}while(0) using namespace std; typedef long long int lint; template ostream& operator << (ostream& ostr, const vector<_Ty>& v) { if (v.empty()) { cout << "{ }"; return ostr; } cout << "{" << v.front(); for (auto itr = ++v.begin(); itr != v.end(); itr++) { cout << ", " << *itr; } cout << "}"; return ostr; } int yuki0004() { int N, tmp, sum = 0; cin >> N; vector W(N + 1, 0); for (int i = 1; i <= N; i++) { cin >> tmp; W[i] = tmp; sum += tmp; } if (sum % 2 == 1) { cout << "impossible" << endl; return 0; } sum /= 2; vector < vector < bool > > dp(N + 1, vector(sum + 1, false)); dp[0][0] = 1; for (int i = 1; i <= N; i++) { for (int j = 0; j <= sum; j++) { if (dp[i - 1][j]) { if (j + W[i] == sum) { cout << "possible" << endl; return 0; } dp[i][j] = true; if (j + W[i] < sum) { dp[i][j + W[i]] = true; } } } } cout << "impossible" << endl; return 0; } int main() { //clock_t start, end; //start = clock(); yuki0004(); //end = clock(); //printf("%d msec.\n", end - start); return 0; }