F1. Eating Brownies (Easy)
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
3 4 1
1001
1111
0011
Output
3
2 4