Pay for the purchase without change
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
In a certain country, coins come in two denominations: M1 and M2 units. How many different ways can you pay for a purchase worth N units using these coins, ensuring that no change is needed? Two ways are considered different if they involve a different number of coins of at least one denomination.
Input Data
The input consists of a single line with three natural numbers: N, M1, and M2 (where ( N, M1, M2 < 10^6 ) and ( M1 \neq M2 )).
Output Data
Output a single number, which is the answer to the problem.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 14%