B. Binary Palindromes
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
4
3 3
100
010
6 3
101101
101
2 3
01
001
4 1
1000
1
Output
2
15
1
4