{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cfont class\u003d\"Apple-style-span\" color\u003d\"#FFFFFF\" face\u003d\"\u0027Arial Black\u0027\"\u003e\u003cspan class\u003d\"Apple-style-span\" style\u003d\"font-size: xx-large; -webkit-border-horizontal-spacing: 3px; -webkit-border-vertical-spacing: 3px;\"\u003e\u003cspan class\u003d\"Apple-style-span\" style\u003d\"color: rgb(34, 34, 34); font-family: \u0027Times New Roman\u0027; font-size: medium; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; \"\u003eA \u003cb\u003epalindrome\u003c/b\u003e is a string that reads the same from the left as it does from the right. For example, I, GAG and MADAM are palindromes, but ADAM is not. Here, we consider also the \u003ci\u003eempty string\u003c/i\u003e as a palindrome.\u003c/span\u003e\u003c/span\u003e\u003c/font\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cimg align\u003d\"right\" border\u003d\"1\" src\u003d\"http://uva.onlinejudge.org/external/111/p11151.gif\" /\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\tFrom any non-palindromic string, you can always take away some letters, and get a palindromic subsequence. For example, given the string ADAM, you remove the letter M and get a palindrome ADA.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cb\u003eWrite a program\u003c/b\u003e to determine the length of the longest palindrome you can get from a string.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003ca name\u003d\"SECTION00001000000000000000\"\u003e\u003cfont color\u003d\"#550077\"\u003eInput and Output\u003c/font\u003e\u003c/a\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tThe first line of input contains an integer \u003cb\u003e\u003ci\u003eT\u003c/i\u003e\u003c/b\u003e (\u0026le; 60). Each of the next \u003cb\u003e\u003ci\u003eT\u003c/i\u003e\u003c/b\u003e lines is a string, whose length is always less than 1000.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tFor \u003cspan data-scayt_word\u003d\"≥90\" data-scaytid\u003d\"1\"\u003e\u0026ge;90\u003c/span\u003e% of the test cases, string length \u0026le; 255.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tFor each input string, your program should print the length of the longest palindrome you can get by removing zero or more characters from it.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003ca name\u003d\"SECTION00003000000000000000\"\u003e\u003cfont color\u003d\"#550077\"\u003eSample Input\u003c/font\u003e\u003c/a\u003e\u003c/h2\u003e\r\n\u003cpre\u003e\r\n2\r\nADAM\r\nMADAM\r\n\u003c/pre\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003ca name\u003d\"SECTION00004000000000000000\"\u003e\u003cfont color\u003d\"#550077\"\u003eSample Output\u003c/font\u003e\u003c/a\u003e\u003c/h2\u003e\r\n\u003cpre\u003e\r\n3\r\n5\r\n\u003c/pre\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003chr /\u003e\r\n\u003caddress\u003e\r\n\t\u003cspan data-scayt_word\u003d\"Problemsetter\" data-scaytid\u003d\"2\"\u003eProblemsetter\u003c/span\u003e: Raymond Chun\u003c/address\u003e"}}]}