{"problem":{"name":"evall","description":{"content":"You are given a string $S$. Each character of $S$ is one of `123456789+*`, and the first and last characters of $S$ are digits. There are no adjacent non-digit characters in $S$. For a pair of integer","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc338_g"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$. Each character of $S$ is one of `123456789+*`, and the first and last characters of $S$ are digits. There are no adjacent non-digit characters in $S$.\nFor a pair of integers $i, j$ ($1 \\leq i \\leq j \\leq |S|$), we define $\\mathrm{eval}(S_{i..j})$ as follows:\n\n*   If both the $i$\\-th and $j$\\-th characters of $S$ are digits, then $\\mathrm{eval}(S_{i..j})$ is the result of evaluating the $i$\\-th to the $j$\\-th characters (inclusive) of $S$ as a usual arithmetic expression (where `*` represents multiplication). For example, if $S =$ `1+2*151`, then $\\mathrm{eval}(S_{1..6}) = 1 + 2 \\times 15 = 31$.\n*   Otherwise, $\\mathrm{eval}(S_{i..j})$ is zero.\n\nFind ${\\displaystyle \\sum_{i=1}^{|S|} \\sum_{j=i}^{|S|} \\mathrm{eval}(S_{i..j})}$, modulo $998244353$.\n\n## Constraints\n\n*   $1 \\leq |S| \\leq 10^6$\n*   Each character of $S$ is one of `123456789+*`.\n*   The first and last characters of $S$ are digits.\n*   There are no adjacent non-digit characters in $S$.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc338_g","tags":[],"sample_group":[["1+2*34","197\n\nThe cases where $\\mathrm{eval}(S_{i..j})$ is not zero are as follows:\n\n*   $\\mathrm{eval}(S_{1..1}) = 1$\n*   $\\mathrm{eval}(S_{1..3}) = 1 + 2 = 3$\n*   $\\mathrm{eval}(S_{1..5}) = 1 + 2 \\times 3 = 7$\n*   $\\mathrm{eval}(S_{1..6}) = 1 + 2 \\times 34 = 69$\n*   $\\mathrm{eval}(S_{3..3}) = 2$\n*   $\\mathrm{eval}(S_{3..5}) = 2 \\times 3 = 6$\n*   $\\mathrm{eval}(S_{3..6}) = 2 \\times 34 = 68$\n*   $\\mathrm{eval}(S_{5..5}) = 3$\n*   $\\mathrm{eval}(S_{5..6}) = 34$\n*   $\\mathrm{eval}(S_{6..6}) = 4$\n\nThe sum of these is $1+3+7+69+2+6+68+3+34+4 = 197$."],["338*3338*33338*333338+3333338*33333338+333333338","527930018"]],"created_at":"2026-03-03 11:01:14"}}