Distinct Sums Grid
Create an n \times n grid that fulfills the following requirements: - Each integer 1 \dots n appears n times in the grid. - If we create a set that consists of all sums in rows and columns, there are 2n distinct values. Input The only line has an integer n. Output Print a grid that fulfills the requirements. You can print any valid solution. If there are no solutions, print IMPOSSIBLE. Cons
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start