All submissions for this problem are available.
Ravi Shastri: Its bright sunshine at capetown and India takes on Pakistan. Its hot here!!! And tension all over the ground as this is the last over. Misbhah-ul Haq on batting. Pakistan needs 6 runs to win and this is their last wicket. Here he goes, plays reverse sweep.Straight up in the air. Shreesant takes the catch. India has won the world cup!!!
Bad approach by Misbhah. 6 runs from 6 balls required and he plays for 6 on the first ball.
Now you need to develop a program that will help teams to win with best approach. You will be given number of overs remaining and number of runs required to win the match. Consider all the runs are scored from bat. Player can’t score more than 2 runs per ball except one four per over(has to be there). You need to find maximum number of ways to win the match on last ball.
Standard Input consists of a number of lines. First line has number of test cases t. Next line contains n i.e. number of overs left, followed by a space then an integer m which is for number of runs required to win the match.
m- integer 0<=m<=100
Standard output should contain maximum no. possible ways to win the match on last ball for each case in a new line. In the end there should be three stars.
input: 2 2 5 1 4 output: 6 1 ***
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, D, PERL, FORT, ADA, ASM, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, TCL, PERL6, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.