public static int solution(int len, int gridLen, int x, int y) {
//每一行或者每一列有多少个格栅
int per = len / gridLen;
//这个行列是格栅的行列 都是从一开始算起
int row = x / gridLen + 1;
int col = y / gridLen + 1;
int res;
if (row == 1) {
res = col;
} else {
res = per * (row - 1) + col;
}
return res;
}