Divisors
Time limit2sMemory limit512 MB
Count increasing sequences of k divisors of n where each adjacent pair is coprime and the product of all k numbers is at most n.
- Level
Medium7 of 10
- Topics
- Dynamic programming, Number theory, Backtracking
- Solved
- No attempts yet
Problem
A natural number is a divisor of a natural number if for some natural number . For example, the divisors of 6 are 1, 2, 3, and 6. Two numbers are called coprime if they have no common divisor other than 1. For example, 16 and 27 are coprime, while 18 and 24 are not.
A set of numbers is called normal if all of the following conditions hold:
- Each is a divisor of .
- .
- For every from 1 to , and are coprime.
- The product does not exceed .
For example, is a normal set of 3 divisors of 360.
Given and , count the normal sets of divisors of .
Input
The first line contains two integers and (, ).
Output
Print one integer: the number of normal sets of divisors of .