| TheForces Round #10 (TEN-Forces) |
|---|
| Закончено |
$$$S$$$ is the set of certain integers. If the difference between any two integers in the set is not greater than $$$k$$$, $$$S$$$ is considered good.
You are given an array $$$a$$$ of length $$$n$$$.
Your task is to find the number of non-empty good subarrays and non-empty good subsequences.
Print them modulo 998244353.
The first line contains a single integer $$$t$$$ $$$(1 \le t \le 10^5)$$$ — the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ $$$(1 \le n \le 2 ⋅ 10^5)$$$ and $$$k$$$ $$$(0 \le k \le 10^{18})$$$.
The second line of each test case contains $$$n$$$ integers $$$a_1,a_2 \dots a_n$$$ $$$(-10^{18} \le a_i \le 10^{18})$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 ⋅ 10^5$$$.
For each test case, output two integers — good subarrays and good subsequences.
2 4 2 4 5 8 3 7 21 32 19 -2 -5 0 -11 9
5 8 19 41
| Название |
|---|


