#include //std::cout, std::cin #include //std::string,std::to_string(C++11) #include //std::vector #include //std::valarray #include //std::sort #include //localtime_s #include //abs #include //abs,std::pow,sqrt,sin,cos,round,floor,ceil #include //std::ifstream,std::ofstream #include //std::setprecision,std::setw,std::setfill #include //std::random(C++11) #include //std::accumulate #include //std::greater #include //std::chrono(C++11) #include //std::bitset #include //std::queue const static double de_PI = 3.14159265358979323846; const static unsigned int de_MOD = 1000000007; const static int de_MAX = 999999999; void Calc(bool *flg, const int digit, const int compare, std::vector &W, int total, const int st) { for (unsigned int i = st; !*flg && i < W.size(); i++) { total += W[i]; if (total > compare) { break; } if (digit > 1) { Calc(flg, digit - 1, compare, W, total, st + 1); } if (total == compare) { *flg = true; } } } int main(void) { //std::ifstream in("123.txt"); std::cin.rdbuf(in.rdbuf()); //std::ofstream ofs("456.csv"); //std::chrono::system_clock::time_point t_st = std::chrono::system_clock::now(); int N = 0, sum = 0; std::cin >> N; std::vector W(N); for (int i = 0; i < N; i++) { std::cin >> W[i]; sum += W[i]; } if (sum % 2 == 1) { std::cout << "impossible" << std::endl; return 0; } std::sort(W.begin(), W.end()); bool flg = false; for (int i = 1; i <= N / 2; i++) { Calc(&flg, i, sum / 2, W, 0, 0); } if (flg) { std::cout << "possible" << std::endl; } else { std::cout << "impossible" << std::endl; } //std::chrono::system_clock::time_point t_ed = std::chrono::system_clock::now(); //std::cout << std::chrono::duration_cast(t_ed - t_st).count() << "ms" << std::endl; }