Modulo Number

AtCoder
IDabc266_b
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
998244354
Output #1
1

$998244354-1 = 998244353$ is a multiple of $998244353$, so the condition is satisfied.
Input #2
\-9982443534
Output #2
998244349

$-9982443534-998244349= -10980687883$ is a multiple of $998244353$, so the condition is satisfied.
API Response (JSON)
{
  "problem": {
    "name": "Modulo Number",
    "description": {
      "content": "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",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc266_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given an integer $N$ between $-10^{18}$ and $10^{18}$ (inclusive).\nFind an integer $x$ between $0$ and $998244353 - 1$ (inclusive) that satisfies the following condition. It can be proved that...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments