| CodEMI 2025 |
|---|
| Закончено |
Find the number of finite arithmetic sequences with a common difference of $$$D$$$ and a total sum $$$S$$$.
That is find the number of sequences $$$u_0, ... u_n$$$ for some such that forall $$$0 \le i \lt n, u_{i + 1} - u_{i} = D$$$ and $$$u_0 + ... u_n = S$$$.
Input you will be given two integers $$$D, S (1 \le S \le 10^{12}, 1 \le D \le 10^{18})$$$
Output the number of finite arithmetic sequences with a common difference of $$$D$$$ and a total sum of $$$S$$$.
1 8
1
| Название |
|---|


