传统题 1000ms 256MiB

B - Modulo Number

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

B - Modulo Number

Score : $200$ points

Problem Statement

You are given an integer $N$ between $-10^{18}$ and $10^{18}$ (inclusive).

Find an integer $x$ between $0$ and $998244353 - 1$ (inclusive) that satisfies the following condition. It can be proved that such an integer is unique.

  • $N-x$ is a multiple of $998244353$.

Constraints

  • $N$ is an integer between $-10^{18}$ and $10^{18}$ (inclusive).

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer.


998244354
1

$998244354-1 = 998244353$ is a multiple of $998244353$, so the condition is satisfied.


-9982443534
998244349

$-9982443534-998244349= -10980687883$ is a multiple of $998244353$, so the condition is satisfied.

2024暑假入门组刷题营第三期(四)

未参加
状态
已结束
规则
IOI
题目
8
开始于
2024-7-11 13:00
结束于
2024-7-11 15:00
持续时间
2 小时
主持人
参赛人数
8