{"raw_statement":[{"iden":"problem statement","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$."},{"iden":"constraints","content":"*   $1\\leq N\\leq 10^{14}$\n*   $1\\leq K\\leq 100$"},{"iden":"input","content":"Input is given from Standard Input from the following format:\n\n$N$ $K$"},{"iden":"sample input 1","content":"10 2"},{"iden":"sample output 1","content":"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$."},{"iden":"sample input 2","content":"10 10"},{"iden":"sample output 2","content":"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$."},{"iden":"sample input 3","content":"10000 10"},{"iden":"sample output 3","content":"862816"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}