The 1×1 cells located around the perimeter of a 3×3 square are filled with the numbers 1,2,…,8 so that the sums along each of the four sides are equal. In the upper left corner cell is the number 8, and in the upper left is the number 6 (see the figure below).
https://i.ibb.co/bRmd12j/Kyiv-MO-2021-Round-1-8-2.png
How many different ways to fill the remaining cells are there under these conditions?Proposed by Mariia Rozhkova permutationsMagic squarescombinatorics