~/algor $ cat problems/sonlar-diofant-yechimlari
Solutions of a Diophantine equation
Medium
1000 ms
128 MB
53%
You are given positive integers $a$, $b$ and a non-negative integer $c$. How many integer solutions $(x, y)$ with $x \ge 0$, $y \ge 0$ does the equation $a \cdot x + b \cdot y = c$ have?
Input
One line with three integers: $a$, $b$ and $c$.
Output
One integer — the number of solutions.
Note
$1 \le a, b \le 10^{9}$
$0 \le c \le 10^{18}$
Examples
Input #1
2 3 12
Output #1
3
Input #2
4 6 7
Output #2
0