[BOJ 7492] Bukazoids

View as PDF

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Secret laboratory of Fatown has developed a new gluttonous robot which oves on stripe consisting of n+1 cells. Cells are numbered from 0 to n. The robot is located at cell with number 0; each other cell contains several bukazoids which gluttonous robot regales oneself with. The robot can do m single jumps (to adjacent cell) and kdouble jumps (over one cell). Additionally, m + 2k = n. All jumps are jumps forward. To feed gluttonous robot you need to write a program which finds sequence of jumps with highest number of bukazoids on a way.

입력 형식

The first line at the input contains 3 integers: n (1 ≤ n ≤ 100), m (0 ≤ m ≤ 100), k (0 ≤ k ≤ 100). The second line contains n integers – number of bukazoids (up to 100) in corresponding cells of the stripe.

출력 형식

The first line at the output should contain highest number of bukazoids found. The second line should contain m+k+1 integers – numbers of cells visited by the robot, starting from cell with number 0.

예제 입력

5 1 2
5 2 7 3 1

예제 출력

13
0 1 3 5

Comments

There are no comments at the moment.