eolymp
bolt
Try our new interface for solving problems
Problems

x1+...+xk = n

x1+...+xk = n

Given the values of $k$ and $n$, find the number of positive 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 positive integral solutions for the given equation. It is known that the answer is no more than $10^{18}$. \Example There are $3$ positive integer solutions to the equation $x_1 + x_2 + x_3 = 4$: \begin{itemize} \item $(1,1,2)$ \item $(1,2,1)$ \item $(2,1,1)$ \end{itemize}
Time limit 1 second
Memory limit 128 MiB
Input example #1
3 4
Output example #1
3