{"problem":{"name":"Delete 1, 4, 7, ...","description":{"content":"You are given an integer $N$. On an integer sequence $A = (1, 2, \\ldots, N)$, let us do the operation below exactly $K$ times. *   Let $n$ be the current number of terms in $A$. For all $i$ such 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":"arc135_f"},"statements":[{"statement_type":"Markdown","content":"You are given an integer $N$. On an integer sequence $A = (1, 2, \\ldots, N)$, let us do the operation below exactly $K$ times.\n\n*   Let $n$ be the current number of terms in $A$. For all $i$ such that $1\\leq i \\leq n$ and $i\\equiv 1\\pmod{3}$, delete the $i$\\-th term of $A$, simultaneously.\n\nFind the sum of the terms of $A$ after $K$ operations, modulo $998244353$.\n\n## Constraints\n\n*   $1\\leq N\\leq 10^{14}$\n*   $1\\leq K\\leq 100$\n\n## Input\n\nInput is given from Standard Input from the following format:\n\n$N$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc135_f","tags":[],"sample_group":[["10 2","25\n\n*   Initially, we have $A = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)$.\n*   After the first operation, we have $A = (2, 3, 5, 6, 8, 9)$.\n*   After the second operation, we have $A = (3, 5, 8, 9)$.\n*   The sum of the terms here is $3 + 5 + 8 + 9 = 25$."],["10 10","0\n\n*   After the second operation, we have $A = (3, 5, 8, 9)$ (same as Sample Input 1).\n*   After the third operation, we have $A = (5, 8)$.\n*   After the fourth operation, we have $A = (8)$.\n*   After the fifth operation, $A$ is empty.\n*   In the sixth and subsequent operations, $A$ remains empty, where the sum of the terms is $0$."],["10000 10","862816"]],"created_at":"2026-03-03 11:01:14"}}