eolymp
bolt
Try our new interface for solving problems
Problems

x1+...+xk = n (2)

x1+...+xk = n (2)

Given values of $k$ and $n$, find the number of nonnegative integral solutions for the equation $$ x_1 + x_2 + ... + x_k = n $$ \InputFile Two positive integers $k$ and $n~(k \le n \le 100)$. \OutputFile Print the number of nonnegative integral solutions for the given equation. It is known that the answer is no more than $10^{18}$. \Example There are $15$ nonnegative integer solutions to the equation $x_1 + x_2 + x_3 = 4$: \begin{itemize} \item $(4,0,0)$ and its $3$ permutations \item $(3,1,0)$ and its $6$ permutations \item $(2,2,0)$ and its $3$ permutations \item $(2,1,1)$ and its $3$ permutations \end{itemize} In total there are $3 + 6 + 3 + 3 = 15$ solutions.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3 4
Output example #1
15