use proconio::input; fn main() { input! { n: usize, w: [usize; n], } let sum = w.iter().sum::(); if sum % 2 == 1 { println!("impossible"); return; } let mut dp = vec![0; sum + 1]; dp[0] = 1; for i in 0..n { let mut ndp = dp.clone(); for j in w[i]..=sum { ndp[j] |= dp[j - w[i]]; } dp = ndp; } if dp[sum/2] == 1 { println!("possible"); }else { println!("impossible"); } }