Yesterday a new contest from azspcs.net began. It will last 3 months, so that everyone will have time to participate. The task is the following: you need to come up with 2 * 25 squares of size NxN (from 3x3 to 27x27). In the squares of the square you need to put down the numbers from 1 to N ^ 2 (respectively, "from 1 to 9" for the smallest square and "from 1 to 729" for the largest square), the numbers do not repeat. Further for each square is considered a number according to the following rules:
Each pair of numbers from a square is taken;
For this pair of numbers, gcd is sought
For this pair of numbers, we look for the square of the distance between them, for example, if the first number is written in a 1x1 cell, and the second in a 2x2 cell, then the square of the distance between them is 2 (according to the Pythagorean theorem, the square of the hypotenuse is equal to the sum of the squares of the legs, that is, 1 + 1 = 2 );
GCD and squared distance are multiplied;
The results obtained in the previous step are added for each pair of numbers.
It is necessary to minimize this number (one task) and maximize it (another task). Total 2x25 tasks. An interesting system of scoring: for each of the 25 tasks, the found minimum solution is subtracted from the maximum solution, this is the “player's result on the problem”. Since no one knows the exact solution of the problem (at least for 27x27 exactly), therefore, one point gets the solution that is currently the best among all players. The remaining players receive a percentage of one point, depending on their result. If someone finds a solution better than everything that happened to him, he gets one point, and the rest of the players are cut off. ')
If it became interesting - you are here .