(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (ws (loop repeat n collect (read))) (s (reduce #'+ ws))) (when (oddp s) (format t "impossible~%") (return-from main)) (let* ((s/2 (floor (/ s 2))) (dp (make-array (1+ s/2) :initial-element 0))) (setf (aref dp 0) 1) (loop for w in ws do (loop for i downfrom s/2 to 0 do (when (<= (+ i w) s/2) (setf (aref dp (+ i w)) (logior (aref dp (+ i w)) (aref dp i)))))) (format t "~a~%" (if (zerop (aref dp s/2)) "impossible" "possible"))))) (main)