J. Justice for the Underdogs
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You just looked at a flier for the upcoming inter-university bowling tournament. Your university is looking for a team to represent it, but you're still hesitating on applying as you think you're not good enough. Meanwhile, you got more interested in the problem of how the team should be formed.

For the tournament, a team should consist of $$$K$$$ people, and you know that $$$N$$$ participants from your university have applied to represent it. You're totally convinced that the skill of a team is determined by its weakest link, meaning the team member with the lowest ability. Thus, for a team $$$T$$$ where each member has a bowling ability of $$$a_i$$$ ($$$1 \leq i \leq |T|$$$), the total ability of the team is the minimum across all members ($$$T_a = min(a_1, a_2, \dots a_{|T|}$$$). Your university has a special characteristic where the abilities of the $$$N$$$ registered participants are unique, thus forming a permutation of integers from $$$1 \dots N$$$.

You want to know the sum of the abilities of each of the representing teams of $$$K$$$ members that could be formed from the $$$N$$$ registered participants, taking into account how the team's ability is calculated.

You would like to compute the previous value for a lot of pairs of team size ($$$K$$$) and registered participants ($$$N$$$), but you got to do it fast before your university's team gets selected!

Input

In the first line, you're given an integer $$$Q$$$ $$$-$$$ ($$$1 \leq Q \leq 10^5$$$) $$$-$$$ the number of queries you will be asked.

For each of the next $$$Q$$$ lines, you will get two integers $$$N$$$ and $$$K$$$ $$$-$$$ ($$$1\leq K \leq N \leq 10^6$$$) $$$-$$$ the number of registered participants and the size that the teams should have, respectively.

Output

For each of the $$$Q$$$ lines, you should print one integer, the answer to the query. Since the answer can be pretty big, print it modulo $$$998244353$$$.

Example
Input
5
5 3
2 1
11 4
23583 237
1000000 35624
Output
15
3
792
854389980
475464584