Strange Number 2
Time limit2sMemory limit1024 MB
Given N up to 1e9, sum f(A,B) over all pairs 1 to N, where f counts C whose GCD with A and LCM with B match the stated values.
- Level
Hard8 of 10
- Topics
- Number theory, Math, Divide and conquer
- Solved
- No attempts yet
Problem
Given two positive integers and , let be the number of positive integers that satisfy both of the following conditions.
,
Find the value of .
is the greatest common divisor of and , and is the least common multiple of and .
Input
A single positive integer is given.
Output
Print the value of . Within the input range, this value is guaranteed to be less than .