9048: GCD Magic

内存限制:128 MB 时间限制:5 S
题面:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

Z is learning GCD theory and he finds a difficult problem:
$$\sum_{i=1}^{n}\sum_{j=1}^{n}[gcd(2^i-1,2^j-1)]^K$$
He doesn’t know how to solve it, but he knows it’s easy for you. Please help him. Since the answer can be very large, you only need to print the answer mod 998244353.

输入格式

The first line contains one integer T (1 ≤ T ≤ 12) which represents the number of test cases. For each test case: One line contains two integers n (1 ≤ n ≤ 109 ) and K (0 ≤ K ≤ 10).

输出格式

For each test case: Print one line containing one integer which represents the answer

输入样例 复制

3
3 1
3 2
3 3

输出样例 复制

17
65
377