{"problem":{"name":"String Coloring","description":{"content":"You are given a string $S$ of length $2N$ consisting of lowercase English letters. There are $2^{2N}$ ways to color each character in $S$ red or blue. Among these ways, how many satisfy the following ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc026_c"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ of length $2N$ consisting of lowercase English letters.\nThere are $2^{2N}$ ways to color each character in $S$ red or blue. Among these ways, how many satisfy the following condition?\n\n*   The string obtained by reading the characters painted red **from left to right** is equal to the string obtained by reading the characters painted blue **from right to left**.\n\n## Constraints\n\n*   $1 \\leq N \\leq 18$\n*   The length of $S$ is $2N$.\n*   $S$ consists of lowercase English letters.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc026_c","tags":[],"sample_group":[["4\ncabaacba","4\n\nThere are four ways to paint the string, as follows:\n\n*   cabaacba\n*   cabaacba\n*   cabaacba\n*   cabaacba"],["11\nmippiisssisssiipsspiim","504"],["4\nabcdefgh","0"],["18\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","9075135300\n\nThe answer may not be representable as a $32$\\-bit integer."]],"created_at":"2026-03-03 11:01:13"}}