Submit | All submissions | Best solutions | Back to list |
DIVCNTK - Counting Divisors (general) |
Let be the number of positive divisors of .
For example, , and .
Let
Given and , find .
Input
There are multiple test cases. The first line of input contains an integer (), indicating the number of test cases. For each test case:
The first line contains two integers and ().
Output
For each test case, output a single line containing .
Example
Input: 5 1 3 2 3 3 3 10 3 100 3 Output: 1 5 9 73 2302
Information
There are 5 Input files.
- Input #1: , TL = 1s.
- Input #2: , TL = 5s.
- Input #3: , TL = 5s.
- Input #4: , TL = 5s.
- Input #5: , TL = 5s.
My C++ solution runs in 5.6 sec. (total time)
Notes
This is general version of DIVCNT1, DIVCNT2 and DIVCNT3. You may want to solve these three problems first.
Added by: | zimpha |
Date: | 2018-01-11 |
Time limit: | 1s-5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
hide comments
2018-01-14 04:45:47 zimpha
@[Rampage] Blue.Mary Input: 1 1000 42 Output: 149315662 |
|
2018-01-14 03:04:26 [Rampage] Blue.Mary
Please provide one test with k != 1,2,3. |