Test cases failing

My input test are not passing even though the output is correct

You are considering only one input of given n and m
3 4
1 2 3 4
5 6 7 8
9 10 11 12

but there may be some different input
so you have to take input
using cin>>arr[i][j];

Modified code