{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ of length $N$ consisting of `o` and `x`, and integers $M$ and $K$.  \n$S$ is guaranteed to contain at least one `x`.\nLet $T$ be the string of length $NM$ obtained by concatenating $M$ copies of $S$. Consider replacing exactly $K$ `x`'s in $T$ with `o`.  \nYour objective is to have as long a contiguous substring consisting of `o` as possible in the resulting $T$.  \nFind the maximum length of a contiguous substring consisting of `o` that you can obtain."},{"iden":"constraints","content":"*   $N$, $M$, and $K$ are integers.\n*   $1 \\le N \\le 3 \\times 10^5$\n*   $1 \\le M \\le 10^9$\n*   $1 \\le K \\le x$, where $x$ is the number of `x`'s in the string $T$.\n*   $S$ is a string of length $N$ consisting of `o` and `x`.\n*   $S$ has at least one `x`."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$ $K$\n$S$"},{"iden":"sample input 1","content":"10 1 2\nooxxooooox"},{"iden":"sample output 1","content":"9\n\n$S=$ `ooxxooooox` and $T=$ `ooxxooooox`.  \nReplacing `x` at the third and fourth characters with `o` makes $T=$ `ooooooooox`.  \nNow we have a length-$9$ contiguous substring consisting of `o`, which is the longest possible."},{"iden":"sample input 2","content":"5 3 4\noxxox"},{"iden":"sample output 2","content":"8\n\n$S=$ `oxxox` and $T=$ `oxxoxoxxoxoxxox`.  \nReplacing `x` at the $5,7,8$ and $10$\\-th characters with `o` makes $T=$ `oxxooooooooxxox`.  \nNow we have a length-$8$ contiguous substring consisting of `o`, which is the longest possible."},{"iden":"sample input 3","content":"30 1000000000 9982443530\noxoxooxoxoxooxoxooxxxoxxxooxox"},{"iden":"sample output 3","content":"19964887064"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}