第 540 题:(2016 AIME II, 13)
Beatrix is going to place six rooks on a $6 \times 6$ chessboard where both the rows and columns are labeled $1$ to $6$; the rooks are placed so that no two rooks are in the same row or the same column. The \textit{value} of a square is the sum of its row number and column number. The \textit{score} of an arrangement of rooks is the least value of any occupied square. The average score over all valid configurations is $\frac{p}{q}$, where $p$ and $q$ are relatively prime positive integers. Find $p+q$.
- A configuration is a permutation $\sigma$, and the score is $\min_i(i+\sigma(i))\ge2$. So the average is $2+\sum_{s\ge3}\frac{N_s}{720}$, where $N_s$ counts permutations with all $i+\sigma(i)\ge s$.
- Filling the most constrained rows first: $N_3=720-120=600$, $N_4=4\cdot4\cdot4!=384$, $N_5=3^3\cdot3!=162$, $N_6=2^4\cdot2=32$, $N_7=1$.
- Average $2+\frac{1179}{720}=\frac{291}{80}$, so $p+q=371$. The answer is $\boxed{371}$.
Beatrix is going to place five rooks on a $5 \times 5$ chessboard where both the rows and columns are labeled $1$ to $5$; the rooks are placed so that no two rooks are in the same row or the same column. The \textit{value} of a square is the sum of its row number and column number. The \textit{score} of an arrangement of rooks is the least value of any occupied square. The average score over all valid configurations is $\frac{p}{q}$, where $p$ and $q$ are relatively prime positive integers. Find $p+q$.