Counting Divisors

각 질의에서 l부터 r까지의 i에 대해 i^k의 약수 개수를 모두 더해 998244353으로 나눈 나머지를 구한다. i는 10^12까지 커질 수 있다.

어려움8정수론수학동적 계획법조합론아직 제출이 없습니다시간 제한7초메모리 제한512 MB

문제

In mathematics, the function d(n)d (n) denotes the number of divisors of a positive integer nn.

For example, d(12)=6d (12) = 6 because 11, 22, 33, 44, 66 and 1212 are all divisors of 1212.

In this problem, you are given ll, rr and kk. Your task is to calculate the following:

(_i=lrd(ik))  mod998,244,353.\left( \sum\_{i = l}^{r} d \left( i^k \right) \right)   \bmod 998\\,244\\,353\text{.}

입력

The first line of the input contains an integer TT (1T151 \leq T \leq 15) denoting the number of test cases.

Each test case is given as a line containing three integers ll, rr and kk (1lr10121 \leq l \leq r \leq 10^{12}, rl106r - l \leq 10^6, 1k1071 \leq k \leq 10^7).

출력

For each test case, print a single line containing an single integer: the answer to the test case.