#include #include #include using namespace std; bool isDevideInHalf(int* weights, int n, int index, int total_weight) { if (total_weight == 0) return true; if (index >= n) return false; if (weights[index] <= total_weight) { if (isDevideInHalf(weights, n, index + 1, total_weight - weights[index])) return true; return isDevideInHalf(weights, n, index + 1, total_weight); } return isDevideInHalf(weights, n, index + 1, total_weight); } int main() { int n; cin >> n; int weights[100]; for (int i = 0; i < n; i++) { cin >> weights[i]; } bool is_possible = false; int sum_weight = accumulate(weights, weights + n, 0); if (sum_weight % 2 == 0) { is_possible = isDevideInHalf(weights, n, 0, sum_weight / 2); } string answer = is_possible ? "possible" : "impossible"; cout << answer << endl; return 0; }