{"problem":{"name":"Inserting 'x'","description":{"content":"We have a string $s$ consisting of lowercase English letters. Snuke can perform the following operation repeatedly: *   Insert a letter `x` to any position in $s$ of his choice, including the beginni","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"code_festival_2017_qualc_c"},"statements":[{"statement_type":"Markdown","content":"We have a string $s$ consisting of lowercase English letters. Snuke can perform the following operation repeatedly:\n\n*   Insert a letter `x` to any position in $s$ of his choice, including the beginning and end of $s$.\n\nSnuke's objective is to turn $s$ into a palindrome. Determine whether the objective is achievable. If it is achievable, find the minimum number of operations required.\n\n## Constraints\n\n*   $1 \\leq |s| \\leq 10^5$\n*   $s$ consists of lowercase English letters.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$s$\n\n[samples]\n\n## Notes\n\nA _palindrome_ is a string that reads the same forward and backward. For example, `a`, `aa`, `abba` and `abcba` are palindromes, while `ab`, `abab` and `abcda` are not.","is_translate":false,"language":"English"}],"meta":{"iden":"code_festival_2017_qualc_c","tags":[],"sample_group":[["xabxa","2\n\nOne solution is as follows (newly inserted `x` are shown in bold):\nxabxa → xa**x**bxa → xaxbxa**x**"],["ab","\\-1\n\nNo sequence of operations can turn $s$ into a palindrome."],["a","0\n\n$s$ is a palindrome already at the beginning."],["oxxx","3\n\nOne solution is as follows:\noxxx → **x**oxxx → **x**xoxxx → **x**xxoxxx"]],"created_at":"2026-03-03 11:01:14"}}