102661: [AtCoder]ABC266 B - Modulo Number

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:8 Solved:0

Description

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:

$N$

Output

Print the answer.


Sample Input 1

998244354

Sample Output 1

1

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


Sample Input 2

-9982443534

Sample Output 2

998244349

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

Input

题意翻译

您将获得一个介于 $-10^{18}$和 $10^{18}$(包括 $-10^{18}$和 $10^{18}$ )之间的整数 $N$ 查找满足以下条件的大于或等于 $0$ 且小于 $998244353$ 的整数 $x$; - $N-x$ 是 $998244353$ 的倍数 此外,您可以证明答案是唯一的。

Output

分数:200分

问题描述

你将得到一个在$-10^{18}$到$10^{18}$(包括)之间的整数$N$。

找出一个在$0$到$998244353 - 1$(包括)之间的整数$x$,满足以下条件。可以证明这样的整数是唯一的。

  • $N-x$是$998244353$的倍数。

限制条件

  • $N$是介于$-10^{18}$和$10^{18}$(包括)之间的整数。

输入

输入将从标准输入按照以下格式给出:

$N$

输出

打印答案。


样例输入1

998244354

样例输出1

1

$998244354-1 = 998244353$是$998244353$的倍数,因此满足条件。


样例输入2

-9982443534

样例输出2

998244349

$-9982443534-998244349= -10980687883$是$998244353$的倍数,因此满足条件。

加入题单

算法标签: