cf/mirror

Making Anti-Palindromes

CF
1822E1600· expert1s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
10
10
codeforces
3
abc
10
taarrrataa
10
dcbdbdcccc
4
wwww
12
cabbaccabaac
10
aadaaaaddc
14
aacdaaaacadcdc
6
abccba
12
dcbcaebacccd
Output
0
-1
1
1
-1
3
-1
2
2
2
1822E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)