All submissions for this problem are available.Once Professor , Sergio Marquina was playing a game against his little brother Berlin. The game is played in following manner : Initially, there is a four-digit number and a given number of moves. Both Professor and Berlin take turns alternately (beginning with Berlin). Both of them must increase ANY digit of the number, but if the digit was 9 it will become 0. For example number 1289 can be expanded to: 2289,1389,1299 or 1280. If after all turns the number is greater than the original number,Berlin wins - otherwise Professor is the winner. Both of them play optimally - can you decide who is the winner? PS: It is possible that Berlin will have one more turn (if number of turns is odd). It is also possible that the four digit numbers have leading zeros. ###Input : First line of input will consist $T$ number of test-cases. Each test case will consist of four digit number $N$ [the original number] and $M$ [the number of turns]. ###Output : For each test-case, print the name of winner ("Berlin" or "Professor"). ###Constraints : $1 ≤ T ≤ 200$ $0 ≤ N ≤ 9999$ $0 ≤ M ≤ 100$ ###Sample Input : 5 0000 0 5566 3 3333 10 9999 9 1234 30 ###Sample Output : Professor Berlin Berlin Professor Berlin
|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, rust, SCALA, swift, 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, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.