Please provide an editorial of KNICOV from June COOK OFF challenge . I am not able to grasp the concept that how to solve that problem .
2 Likes
for N=1 there are M knights u can place because Knight can never attack any square in its row itself
for N=2 U can observe that for M=6 we need 4 knights to cover all board,but for M=1 we need 2 ,for M=2,3,4,5 we need 4 knights
for N=3 Same as N=2 i.e.for M=6 we need 4 knights to cover all board,but for M=1 we need 2 ,for M=2,3,4,5 we need 4 knights but there is a catch when doing it for M=14 u can say that for column 1 to 6 (for M=6) we can place 4 knights and for 9 to 14(for M=6) we can place 4 knights but for column 7 to 8 (for M=2) we don’t need to place 4 more knights only 3 will work… so for every n=3 ,m=6k+2 decrease answer by 1
see https://discuss.codechef.com/questions/102406/knicov-june-cook-off
1 Like