N Kings problem (TLE)

I am getting TLE verdict in this problem. It’d be a huge help if someone can tell me where I went wrong. Thanks in advance. This problem came in APAT for web dev (the test is over now.)

Problem:
You are given N, and for a given N x N chessboard, find a way to place N Kings such that no king can attack any other king on the chess board. Each row and column should contain exactly one king. You have to print total number of such configurations.

Input Format:
A single integer N

My solution:
https://hack.codingblocks.com/submission/1899062

You can refer prateek sir video

Hi aman, you pasted the link of hackerblock submission and it will open only if I login with your login ID.
So, paste your code on https://ide.codingblocks.com/ and share the link here.

Thank you for the response.
the correct link: https://ide.codingblocks.com/s/67378

I tried doing it in the same way prateek bhaiya did the N queens problem.

your output for N=5 is 14
Correct output - 10