402905: GYM100942 F GCD and LCM

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. GCD and LCMtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

It is not difficult to find out the greatest common divisor and the least common multiple of several integers. No doubt you have solved such problems ... But have you ever tried to find the integers by their greatest common divisor (GCD) and least common multiple (LCM)? Or, at least, have you determined how many of such sets do GCD and LCM have? Probably, you haven't  ...

Find out how many ordered sets of k positive integers which greatest common divisor and the least common multiple are equal to d and m respectively. For example, for k = 2, d = 2, m = 12, there are four described sets: (2, 12), (12, 2), (4, 6) and (6, 4).

Input

The first line contains one integer k — number of integers in the sets (2 ≤ k ≤ 1018). The second line contains integers d and m — GCD and LCM of integers in the set(1 ≤ d ≤ m ≤ 109).

Output

Output the number of ordered sets by modulo (109 + 9).

ExamplesInput
2
2 12
Output
4
Input
3
4 5
Output
0

加入题单

算法标签: