{"problem":{"name":"Multiple of 2019","description":{"content":"Given is a string $S$ consisting of digits from `1` through `9`. Find the number of pairs of integers $(i,j)$ ($1 ≤ i ≤ j ≤ |S|$) that satisfy the following condition: Condition: In base ten, the $i$\\","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc164_d"},"statements":[{"statement_type":"Markdown","content":"Given is a string $S$ consisting of digits from `1` through `9`.\nFind the number of pairs of integers $(i,j)$ ($1 ≤ i ≤ j ≤ |S|$) that satisfy the following condition:\nCondition: In base ten, the $i$\\-th through $j$\\-th characters of $S$ form an integer that is a multiple of $2019$.\n\n## Constraints\n\n*   $1 ≤ |S| ≤ 200000$\n*   $S$ is a string consisting of digits from `1` through `9`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc164_d","tags":[],"sample_group":[["1817181712114","3\n\nThree pairs - $(1,5)$, $(5,9)$, and $(9,13)$ - satisfy the condition."],["14282668646","2"],["2119","0\n\nNo pairs satisfy the condition."]],"created_at":"2026-03-03 11:01:13"}}