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

Sequence

Time Limit: 25000/12500 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 42    Accepted Submission(s): 16


Problem Description
A **good** sequence $a_0,a_1,...,a_{tn-1}$ satisfies following criteria:

* $a_0=0,a_{tn-1}=2tn-1,1 \leq a_{k+1}-a_k \leq d\ (0 \leq k < tn-1)$.

* $\forall\ i,j,\ a_j-a_i \not= kn\ (k\ \text{is any odd number, }0 \leq i < j < tn)$

Foreverlasting wants to know the number of **good** sequence.
 

Input
The first line contains integer $T\ (1 \leq T \leq 10^4)$ --- the number of test cases.

The first line of each test case contains three integers $t,n,d\ (1 \leq d \leq 5 \cdot 10^4, 1 \leq t \leq 10^5, 1 \leq n \leq 10^{15})$.

It is guaranteed that the sum of $d$ does not exceed $2 \cdot 10^5$.
 

Output
For each case, output the number of **good** sequence modulo $998244353$.
 

Sample Input
2 1 5 2 2 5 3
 

Sample Output
0 2
 

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-24 17:14:30, Gzip enabled