This is the easy version of the problem. The only difference is that in this version, $$$n, w, b \leq 10^6$$$.
As you may know a standard piano has $$$88$$$ keys ($$$52$$$ white and $$$36$$$ black keys). Burt is quirky and wants to build a piano with $$$n$$$ keys, where the number of white keys is a multiple of $$$w$$$ and the number of black keys is a multiple of $$$b$$$.
Help Burt count the number of valid configurations of black/white keys for his custom piano given the constraints:
The input contains three space-separated integers $$$n, w, b$$$ ($$$0 \leq n, w, b \leq 10^6$$$) — the total number of keys, the required divisor for the number of white keys, and the required divisor for the number of black keys, respectively.
Please output one integer, the total number of different ways Burt can configure his piano.
156 24 60
1
72 9 15
2
81 3 3
28
10 2 1
6
Explanation for first two sample cases:
First sample case: The only valid piano with $$$156$$$ keys satisfying the constraints is one with $$$96$$$ white keys (multiple of $$$24$$$) and $$$60$$$ black keys (multiple of $$$60$$$).
Second sample case: the possible valid $$$72$$$-key pianos are: