##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given a binary string of length .
For a binary string , define its badness as the number of indices such that and .
You have to answer independent queries. In a query , consider only the string . Characters outside this range do not exist for this query.
You may choose at most one non-empty contiguous substring of and reverse it. For each query, output the minimum possible badness of after this operation.
The input is given in the following format:
For each query, output the answer on a separate line.
Reverse positions through inside the considered string.
Reverse positions through inside the considered string.
Reverse positions through inside the considered string.
Reverse positions through inside the considered string.
Reverse positions through inside the considered string.