Sudoku solver backtracking

In the isItSafeCell function, why are we adding 3 to the ts as well as cs in the for loop ?

@abhishekjohri98
In a sudoku, a number should occur only once in a row, column and a 3x3 matrix. Hence we add 3 to check in the 3x3 matrix.

See,
int rs = row - row % 3;
int cs = col - col % 3;
If row<=3, rs will be 0 and cs will also be 0. If row=4, rs will be 3. Now here we need to check in the adjacent 3x3 matrix. Hence we will check from row = 3,4,5 and col = 3,4,5.

image
See this sudoku is divided into 9 3x3 matrixs.