Mission 2 - B3 : The Ques of the Guards 2 (HARD)

Mission 2 - B3 : The Ques of the Guards 2 (HARD)

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

P1026 Mission 2 - B3 : The Ques of the Guards 3 (HARD)

Problem Name: question2hard

Problem Background

After decoding the important message, all the options that the USW is going to do is known. The army that Radar leads is quickly outside the capital of the USW, the WA state.

The President of the USW knows that he is going to lose, so he let the guards open the door. But the guards don’t want to. Only if Radar answers their question right, they will open the door.

So can you help Radar solve the question?

Problem Statement

The Guards need Radar to tell them what’s the sum of the first nthn^{th} element in the Fibonacci Numbers.

Note that we define that F0=0, F1=1F_0=0,\ F_1=1.

Because the number is huge, print the number modulo 998244353998244353.

Input

nn

Output

Fn(mod998244353)F_n\pmod{998244353}

Samples

Input 1

Output 1

Constraints

  • For 2020 points:
    • 1n2000001 \le n \le 200000.
  • For another 4040 points:
    • 1n1091 \le n \le 10^{9}.
  • For 100100 points:
    • 1n10181 \le n \le 10^{18}.

AOCode Round #3 & AOSC #2

未参加
状态
已结束
规则
OI
题目
9
开始于
2022-02-06 18:00
结束于
2022-02-06 20:18
持续时间
2.3 小时
主持人
参赛人数
23