Given are Permutations of $$$(1,2,...N):p(p_1, p_2,...,p_N),q(q_1, q_2, ..., q_N)$$$
When you choose a number in the first permutation, the same position in the second permutation and the same value in the second permutation are both banned.
For example: $$$p:(1,3,2,4), q:(1,2,3,4)$$$
When you choose $$$p[2]=3$$$, you can't choose $$$q[2]$$$ with the same position and also can't choose $$$q[3]=3$$$ with the same val.
Find the ways of choose $$$i$$$ in the first permutation and left $$$j$$$ in the second permutation not banned, for erevy $$$i, j \leq N$$$
$$$N \leq 3000$$$.