All submissions for this problem are available.
A basket can be picked if and only if it has N baskets in it. There is exactly one basket that is not in any of the other baskets. If there are M unpicked baskets, Find the total number of baskets.
Input consists of several test cases. For each case, there would be two integers, N and M, where 1<=N<100000 and 1<=M<100000. The input ends with a case where N=0. You must not process this test case
For each test case, print N and M. Then if the total number of men can be expressible uniquely in an integer, print the number. If the case is impossible print the word "Impossible" without quotes. If there are multiple answers, print the word "Multiple" without the quotes.
Input: 2 5 3 4 3 3 0 0 Output: 2 5 9 3 4 Impossible 3 3 4
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.