N_Knight Problem

code: https://ide.codingblocks.com/s/215731
question: https://hack.codingblocks.com/app/contests/1289/265/problem
not showing any output