#P7614. [COCI 2011/2012 #2] NAJBOLJIH 5

[COCI 2011/2012 #2] NAJBOLJIH 5

Description

Given 88 numbers X1,X2,...,X8X_1, X_2, ..., X_8, choose 55 of them so that the sum of these 55 numbers is as large as possible. Output the sum of these 55 numbers and their indices. The index of XiX_i is ii.

Input Format

The input has 88 lines. The ii-th line contains a positive integer XiX_i. It is guaranteed that all XiX_i are distinct.

Output Format

The output has two lines.

The first line contains an integer, representing the maximum possible sum.

The second line contains 55 integers, representing the indices of the chosen 55 numbers, sorted in ascending order.

20
30
50
48
33
66
0
64
261
3 4 5 6 8
20
0
50
80
77
110
56
48
373
3 4 5 6 7
20
30
50
80
110
11
0
85
355
2 3 4 5 8

Hint

Constraints

For 100%100\% of the testdata, 1Xi1501 \le X_i \le 150.

Notes

The score for this problem follows the original COCI setting, with a full score of 5050.

Translated from COCI2011-2012 CONTEST #2 T1 NAJBOLJIH 5.

Translated by ChatGPT 5