{"problem":{"name":"Swap","description":{"content":"Given is a string $S$ consisting of `K`, `E`, `Y`. How many strings are there that can be obtained with at most $K$ swaps of two adjacent characters in $S$?","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc227_e"},"statements":[{"statement_type":"Markdown","content":"Given is a string $S$ consisting of `K`, `E`, `Y`.\nHow many strings are there that can be obtained with at most $K$ swaps of two adjacent characters in $S$?\n\n## Constraints\n\n*   $2 \\leq |S| \\leq 30$\n*   $0 \\leq K \\leq 10^9$\n*   $S$ consists of `K`, `E`, `Y`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$S$\n$K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc227_e","tags":[],"sample_group":[["KEY\n1","3\n\nWith at most one swap, there are three strings that can be obtained: `KEY`, `EKY`, `KYE`."],["KKEE\n2","4\n\nWith at most two swaps, there are four strings that can be obtained: `KKEE`, `KEKE`, `EKKE`, `KEEK`."],["KKEEYY\n1000000000","90"]],"created_at":"2026-03-03 11:01:14"}}