Easy
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Description
Given a positive integer , consider an matrix where the element in the -th row and -th column is given by . Below is an example for :
$ \begin{bmatrix} 1 & 2 & 3 & 4 \\ 5 & 6 & 7 & 8 \\ 9 & 10 & 11 & 12 \\ 13 & 14 & 15 & 16 \\ \end{bmatrix} $
Your task is to select some numbers from the matrix such that:
-
Exactly two numbers are chosen from each row.
-
Exactly two numbers are chosen from each column.
You need to determine the minimum sum of the numbers that are selected.
Input Format
The first line contains a positive integer , representing the size of the matrix.
Output Format
A single integer, representing the minimum sum of the numbers that are selected.
Sample Input #1
2
Sample Output #1
10
Sample Input #2
4
Sample Output #2
68
2025XCPC集训队&&算法培训 — 综合训练(一)
- 状态
- 已结束
- 规则
- ACM/ICPC
- 题目
- 5
- 开始于
- 2025-8-22 19:00
- 结束于
- 2025-8-22 22:00
- 持续时间
- 3 小时
- 主持人
- 参赛人数
- 21