{"problem":{"name":"Papple Sort","description":{"content":"You are given a string $S$ consisting of lowercase English letters. Determine whether we can turn $S$ into a palindrome by repeating the operation of swapping two adjacent characters. If it is possibl","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc088_c"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ consisting of lowercase English letters. Determine whether we can turn $S$ into a palindrome by repeating the operation of swapping two adjacent characters. If it is possible, find the minimum required number of operations.\n\n## Constraints\n\n*   $1 \\leq |S| \\leq 2 × 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]","is_translate":false,"language":"English"}],"meta":{"iden":"arc088_c","tags":[],"sample_group":[["eel","1\n\nWe can turn $S$ into a palindrome by the following operation:\n\n*   Swap the $2$\\-nd and $3$\\-rd characters. $S$ is now `ele`."],["ataatmma","4\n\nWe can turn $S$ into a palindrome by the following operation:\n\n*   Swap the $5$\\-th and $6$\\-th characters. $S$ is now `ataamtma`.\n*   Swap the $4$\\-th and $5$\\-th characters. $S$ is now `atamatma`.\n*   Swap the $3$\\-rd and $4$\\-th characters. $S$ is now `atmaatma`.\n*   Swap the $2$\\-nd and $3$\\-rd characters. $S$ is now `amtaatma`."],["snuke","\\-1\n\nWe cannot turn $S$ into a palindrome."]],"created_at":"2026-03-03 11:01:13"}}