Quarantine Math
Time limit1.25sMemory limit256 MB
Given n and m up to 1e9, sum the divisor counts of all positive k with (n mod k) + (m mod k) >= k, using number theory.
- Level
Hard8 of 10
- Topics
- Number theory, Math, Brute force, Implementation
- Solved
- No attempts yet
Problem
It's quarantine and you're so bored that you decided to dedicate some time to level up your math skills. Unfortunately, yesterday you bumped into a problem you couldn't solve. However, you've dreamt of this problem for the entire night, so maybe today the luck will be on your side?
For given natural numbers , , let be a set of positive integers such that for every element in this set, , where is the remainder of divided by .
The problem asks to compute the value of the following function: where is the number of positive divisors of the number .
Input
Two natural numbers , . .
Output
One number: the value of the function .
Hint
, , , , ,