問題一覧 > 通常問題

No.1792 Science Koshien

レベル : / AI推定難易度 : 1300 / 実行時間制限 : 1ケース 4.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 51
作問者 : ramdos / テスター : maple_1016
お気に入りにしたユーザー ProblemId : 7364 / 自分の提出
問題文最終更新日: 2021-12-29 12:05:31
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2021 (順位表) の他の問題:
2021/12/29 It was discovered that the actual constraints are smaller than the ones written. The problem statement has been corrected.

Problem Statement

You are a teacher at a local high school. You are now going to choose $4$ of $N$ students to enter a competition called the Science Koshien.

In the Science Koshien, exams are held in 6 subjects: physics, chemistry, biology, earth science, mathematics, and informatics.

The aptitude values of the $i$-th student in each subject are $M_i$ for mathematics, $I_i$ for informatics, $P_i$ for physics, $C_i$ for chemistry, $B_i$ for biology, and $E_i$ for earth science.

The team's ability in each subject is the maximum of the aptitude values of the 4 students in that subject.

In the Science Koshien of your prefecture, the score is the product of the abilities in all subjects.

What is the maximum score you can get?

Input

$N$
$M_1\ I_1\ P_1\ C_1\ B_1\ E_1$
$\vdots$
$M_N\ I_N\ P_N\ C_N\ B_N\ E_N$

  • $4 \le N \le 10^3$
  • $1\le M_i, I_i, P_i, C_i, B_i, E_i\le 1\ 000$
  • Output

    Output the answer on one line. End the output with a newline.

    Sample

    Sample 1
    Input
    8
    3 1 4 1 5 9
    2 6 5 3 5 8
    9 7 9 3 2 3
    8 4 6 2 6 4
    3 3 8 3 2 7
    9 5 1 2 8 8
    4 1 9 7 1 6
    9 3 9 9 3 7
    
    Output
    367416

    By choosing the 1st, 3rd, 6th, and 8th students, the abilities in the subjects can be made 9,7,9,9,8,9.

    Sample 2
    Input
    11
    27 18 28 18 28 45
    90 45 23 53 60 28
    74 71 35 26 62 49
    77 57 24 70 93 69
    99 59 57 49 66 96
    76 27 72 40 76 6
    30 35 35 47 59 45
    71 38 21 78 52 51
    66 42 74 27 46 6
    39 19 32 1 1 30
    59 92 18 17 41 35
    
    Output
    421218040320

    It is optimal to hire the 4th, 5th, 9th, and 11th students.

    Sample 3
    Input
    4
    1 1 1 1 1 1
    1 1 1 1 1 1
    1 1 1 1 1 1
    100 100 100 100 100 100
    
    Output
    1000000000000

    Since there are only 4 students, you have no choice but to take all of them.

    提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。