Problem Link

I think it would be optimal to fill zeros starting from (m,m) and then at a gap of 2*m-2 in each row(because we will cover that much squares of size m*m).

So the minimum zeros required would be around n/(2*m-1)

Same will happen for columns, So the answer should be somewhere around (n/(2*m-1))^2 after just taking care of n%(2m-1) remaining cells.

But on the editorial, It is saying that minimum number of zeros should be (n/m)^2, Can someone tell where am I going wrong?