I have tried all the test cases and still got a WA...
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
freopen("output.txt","w",stdout);
int m,n,q,value[101][101],a,b,temp,cc;
char s[101][101];
scanf("%d", &cc);
while(cc>0){
scanf("%d %d %d", &n, &m ...