pages:
  • 1
Gandom SAYS

salam casi mitune chandta test case bede? chon man har test casi ke be zehnam resid dadm va barnamam dorost khoruji mide vali Output Limit Exceeded mikhore!!!

AMiR SAYS

You should read the input like this:

int t; cin>>t;
while(t--){
    cin>>n>>m;
    // process the input
}
Gandom SAYS

bazam Output Limit Exceeded dad;

man intori neveshte budam:

for ( cin >> N; N; N-- ){

    ...

}

fec nakonam eshtebah bashe chon kheili az soala ro intori accept kardam!!!!

che kar konam?

AMiR SAYS

So I guess you should pay more attention to the input boundries.

Try to generate test cases with maximum M and N and test your code against giant test-cases. Or you can modify your allocated arrays with bigger sizes and submit it again to see what happens.