問題一覧 > 通常問題

No.2600 Avator Height

レベル : / AI推定難易度 : 450 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 162
作問者 : 👑 amentorimaru / テスター : cleantted 👑 seekworser
お気に入りにしたユーザー ProblemId : 10286 / 自分の提出
問題文最終更新日: 2024-01-08 13:25:27
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 414 (順位表) の他の問題:

Problem Statement

In a certain virtual space, you can freely change the size of your own avatar.


Two creatures, Rataryuru and Etowanyu, have decided to run a three-legged race.

The stride lengths of Rataryuru and Etowanyu at their $i$-th step are given by the squares of $R_i,E_i$ below, respectively.

$ R_i = \left\{ \begin{array}{ll} 1 & (i = 1)\\ 1 & (i = 2)\\ R_{i-1}+R_{i-2} & (i \geq 3) \end{array} \right. $

$ E_i = \left\{ \begin{array}{ll} 1 & (i = 1)\\ 3 & (i = 2)\\ E_{i-1}+E_{i-2} & (i \geq 3) \end{array} \right. $

After practicing, Rataryuru's stride turned out to be clearly smaller, so Rataryuru set his avatar size to $5$ times the original.

Given $Q$ positive integers $N_1,N_2,\dots ,N_Q$, find, for each of them, the difference in stride $5\times R_{N_i}^2 - E_{N_i}^2$ modulo $998244353$.

Input

$Q$
$N_1$
$N_2$
$\vdots$
$N_Q$
  • All inputs are integers.
  • $1\le Q \le 2 \times 10^{5}$
  • $1\le N_i \le 2 \times 10^{5}$

Output

Output the $Q$ answers, separated by newlines.

Sample

Sample 1
Input
2
3
200000
Output
4
998244349

For example, in the first case,

$R_3=R_1+R_2=2$

$E_3=E_1+E_2=4$

and so $5\times R_3^2 - E_3^2 = 5 \times 4 - 16 = 4$.

Even when $R_i,E_i$ become huge or the answer is negative, find the remainder modulo $998244353$ so that it is a positive value.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。