NAC | NAPC 2021 Practice Contest (July 10th)


2021-07-10 06:00 AKDT

NAC | NAPC 2021 Practice Contest (July 10th)


2021-07-10 11:00 AKDT
The end is near!
Contest is over.
Not yet started.
Contest is starting in -74 days 12:20:46

Time elapsed


Time remaining


Problem F
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