The spell asks for the length of the longest side, but in the solution, it defines n as the length of the shortest side.
You are correct, sorry about the mix-up. The answer and scores are updated.