{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Feuzem is an unemployed computer scientist who spends his days working at odd-jobs. While on the job he always manages to find algorithmic problems within mundane aspects of everyday life.\n\nToday, while writing down the specials menu at the restaurant he\u0027s working at, he felt irritated by the lack of palindromes (strings which stay the same when reversed) on the menu. Feuzem is a big fan of palindromic problems, and started thinking about the number of ways he could remove letters from a particular word so that it would become a palindrome.\n\nTwo ways that differ due to order of removing letters are considered the same. And it can also be the case that no letters have to be removed to form a palindrome."}},{"title":"Input","value":{"format":"MD","content":"nput starts with an integer **T (\u0026le; 200)**, denoting the number of test cases.\n\nEach case contains a single word **W (1 \u0026le; length(W) \u0026le; 60)**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the total number of ways to remove letters from **W** such that it becomes a palindrome."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\nSALADS\nPASTA\nYUMMY\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 15\nCase 2: 8\nCase 3: 11\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"* For the case `PASTA`, there are 8 ways -\n\n\n\n| # | Removed Characters | Remaining Palindrome |\n| - | ------------------ | -------------------- |\n| 1 | `PAST_` | `A` |\n| 2 | `PAS_A` | `T` |\n| 3 | `PA_TA` | `S` |\n| 4 | `P_STA` | `A` |\n| 5 | `_ASTA` | `P` |\n| 6 | `P_ST_` | `AA` |\n| 7 | `P__T_` | `ASA` |\n| 8 | `P_S__` | `ATA` |\t\n\n"}}]}