/* * main.cpp * * Created on: 2017/10/06 * Author: sep */ #include #include #include #include #include #include #include #include #include #include using namespace std; inline int main003(); inline int main045(); inline int main004(); inline int main4(); int main() { main004(); return 0; } inline int main004() { int num; int *weight; int i, j; int sum = 0; bool **dyp; cin >> num; weight = new int[num]; dyp = new bool*[num + 1]; for (i = 0; i < num; i++) { cin >> weight[i]; dyp[i] = new bool[num * 100 + 1]; sum += weight[i]; } dyp[num] = new bool[num * 100 + 1]; fill(dyp[0], dyp[num], false); if (sum % 2 == 1) { cout << "impossible"; return 0; } dyp[0][0] = true; for (i = 0; i < num; i++) for (j = 0; j <= num * 100; j++) { if (dyp[i][j] == true) { dyp[i + 1][j + weight[i]] = true; dyp[i + 1][j] = true; } } if (dyp[num][sum / 2] == true) { cout << "possible"; } else { cout << "impossible"; } return 0; }