DHANANJAY AND CANDIES
All submissions for this problem are available.$Dhananjay$ brought $K$ candies from the market and he wants to distribute those candies to his $N$ children. As $Dhananjay$ is a bit tricky person, he thought that let's distribute those candies with the following condition: - Every $i+1$th children should have more or equal candies than $i$th children, where $1 \leq i \leq N$. So in how many ways $Dhananjay$ can distribute candies to his children? ###Input: - First-line will contain $T$, the number of test cases. Then the test cases follow. - Each test case contains a single line of input, two integers $N$ and $K$ where $N$ are the number of children and $K$ are the number of candies. ###Output: For each test case, output in a single line, the number of ways of distributing the candies. ###Constraints - $1 \leq T \leq 10$ - $1 \leq N \leq 150$ - $1 \leq K \leq 150$ ###Sample Input: 1 3 4 ###Sample Output: 4 ###EXPLANATION: The number of ways for the given case: $0$ $0$ $4$ $0$ $1$ $3$ $0$ $2$ $2$ $1$ $1$ $2$
|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.