F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

GCD Magic

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 575    Accepted Submission(s): 172


Problem Description
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 $\text{mod}\ 998244353$.
 

Input
The first line contains one integer $T\ (1\le T\le 12)$ which represents the number of test cases.

For each test case: One line contains two integers $n\ (1\le n\le 10^9)$ and $K\ (0\le K\le 10)$.
 

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

Sample Input
3 3 1 3 2 3 3
 

Sample Output
17 65 377
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 15:58:56, Gzip enabled