#P16247. [蓝桥杯 2026 省研究生组] 魔法矩阵能量值

    ID: 18274 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 显示难度入门 上传者: 标签>模拟提交答案2026蓝桥杯省赛

[蓝桥杯 2026 省研究生组] 魔法矩阵能量值

Problem Description

For an n×nn \times n magic matrix MM, we define its energy value calculation rules as follows.

  1. Base energy: The base energy of the element at position (i,j)(i, j) is i×j×(i+j)i \times j \times (i + j).

  2. Diagonal bonus: The energy value of elements on the main diagonal (that is, at (1,1),(2,2),,(n,n)(1,1), (2,2), \ldots, (n,n)) is doubled.

  3. Boundary penalty: The energy value of elements on the matrix boundary (that is, row 11, row nn, column 11, column nn) is halved. If an element lies on multiple boundaries at the same time, its energy value is still halved only once.

  4. Center reward: If nn is odd, the energy value of the element at the center position (n+12,n+12)\left(\frac{n+1}{2}, \frac{n+1}{2}\right) is increased by an additional 100100.

Important reminder: When a position satisfies multiple conditions, you must strictly calculate in the above order: first compute the base energy, then apply the diagonal bonus, then apply the boundary penalty, and finally apply the center reward.
The total energy value of the matrix is the sum of the energy values of all positions.

Example 1: The complete calculation process for a 2×22 \times 2 matrix is as follows.

  • Position (1,1)(1,1): Base energy 1×1×2=21 \times 1 \times 2 = 2, doubled on the main diagonal to 44, boundary penalty ÷2=2\div 2 = 2, since nn is even there is no center reward, energy value =2= 2.

  • Position (1,2)(1,2): Base energy 1×2×3=61 \times 2 \times 3 = 6, not on the main diagonal so no bonus, boundary penalty ÷2=3\div 2 = 3, since nn is even there is no center reward, energy value =3= 3.

  • Position (2,1)(2,1): Base energy 2×1×3=62 \times 1 \times 3 = 6, not on the main diagonal so no bonus, boundary penalty ÷2=3\div 2 = 3, since nn is even there is no center reward, energy value =3= 3.

  • Position (2,2)(2,2): Base energy 2×2×4=162 \times 2 \times 4 = 16, doubled on the main diagonal to 3232, boundary penalty ÷2=16\div 2 = 16, since nn is even there is no center reward, energy value =16= 16.

Total energy value: 2+3+3+16=242 + 3 + 3 + 16 = 24.

Example 2: The complete calculation process for a 3×33 \times 3 matrix is as follows.

  • Position (1,1)(1,1): Base energy 1×1×2=21 \times 1 \times 2 = 2, doubled on the main diagonal to 44, boundary penalty ÷2=2\div 2 = 2, not the center so no reward, energy value =2= 2.

  • Position (1,2)(1,2): Base energy 1×2×3=61 \times 2 \times 3 = 6, not on the main diagonal so no bonus, boundary penalty ÷2=3\div 2 = 3, not the center so no reward, energy value =3= 3.

  • Position (1,3)(1,3): Base energy 1×3×4=121 \times 3 \times 4 = 12, not on the main diagonal so no bonus, boundary penalty ÷2=6\div 2 = 6, not the center so no reward, energy value =6= 6.

  • Position (2,1)(2,1): Base energy 2×1×3=62 \times 1 \times 3 = 6, not on the main diagonal so no bonus, boundary penalty ÷2=3\div 2 = 3, not the center so no reward, energy value =3= 3.

  • Position (2,2)(2,2): Base energy 2×2×4=162 \times 2 \times 4 = 16, doubled on the main diagonal to 3232, not on the boundary so no penalty, center reward +100=132+100 = 132, energy value =132= 132.

  • Position (2,3)(2,3): Base energy 2×3×5=302 \times 3 \times 5 = 30, not on the main diagonal so no bonus, boundary penalty ÷2=15\div 2 = 15, not the center so no reward, energy value =15= 15.

  • Position (3,1)(3,1): Base energy 3×1×4=123 \times 1 \times 4 = 12, not on the main diagonal so no bonus, boundary penalty ÷2=6\div 2 = 6, not the center so no reward, energy value =6= 6.

  • Position (3,2)(3,2): Base energy 3×2×5=303 \times 2 \times 5 = 30, not on the main diagonal so no bonus, boundary penalty ÷2=15\div 2 = 15, not the center so no reward, energy value =15= 15.

  • Position (3,3)(3,3): Base energy 3×3×6=543 \times 3 \times 6 = 54, doubled on the main diagonal to 108108, boundary penalty ÷2=54\div 2 = 54, not the center so no reward, energy value =54= 54.

Total energy value: 2+3+6+3+132+15+6+15+54=2362 + 3 + 6 + 3 + 132 + 15 + 6 + 15 + 54 = 236.

Now, please compute the total energy value of the 13×1313 \times 13 magic matrix.

Output Format

This is an output-only fill-in-the-blank problem. You only need to calculate the result and submit it. The result of this problem is an integer. When submitting the answer, only fill in this integer; any extra content will result in no score.



Hint

Translated by ChatGPT 5