Palindrome
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Palindrome is a string that reads the same left to right and right to left. For example, 1001 – palindrome, 1010 – no. Write a program that converts any string of 0 and 1 in a palindrome by adding to it the minimum number of new characters. Adding new symbols can be left, right and inside the line.
Input
We introduce a string no longer than 100 characters, consisting only of 0 and 1.
Output
Output in the first line of the added characters, second line - the resulting palindrome. If there are several options, display option, which is used in lexicographic order.
Examples
Input #1
Answer #1
Submissions 187
Acceptance rate 6%