Problem D
Eating Out

Alice, Bob, and Clara are eating at a new restaurant today. They’re having trouble deciding what to order, so Alice proposes that they each pick some items from the menu, and then they will order the items that everyone picked. The menu has $m$ items, and Alice, Bob, and Clara will order $a$, $b$, and $c$ items respectively. Is it possible for them to pick some items such that no item is picked by everyone?


The input contains a single line with four integers, $m$, $a$, $b$, $c$, where $1\leq m\leq 100,000$, and $1\leq a, b, c\leq m$.


If it’s possible for Alice, Bob, and Clara to pick some item such that no item on the menu is picked by everyone, print “possible” (without quotes). Otherwise, print “impossible”.

Sample Input 1 Sample Output 1
6 2 2 2
Sample Input 2 Sample Output 2
1 1 1 1

Please log in to submit a solution to this problem

Log in