program main implicit none integer::N,total,i,j, total_weight integer::W(100) integer::dp_memo(0:5000,1:100) data dp_memo/500100*0/ read *, N, W(1:N) total = SUM(W(1:N)) if(MOD(total,2).eq.1) then print '(a)','impossible' return end if do i=N,1,-1 do j=0,total/2 if(j.lt.W(i)) then dp_memo(j,i) = dp_memo(j, i+1) else dp_memo(j,i) = MAX(dp_memo(j,i+1),dp_memo(j-W(i), i+1)+W(i)) endif end do end do if(dp_memo(total/2, 1).eq.total/2) then print '(a)','possible' else print '(a)','impossible' end if end program main