eolymp
bolt
Try our new interface for solving problems
Problems

Bukazoids

Bukazoids

\includegraphics{https://static.e-olymp.com/content/ae/ae5d3e879c02208e64b97732fb3ddbb1ceea652b.gif} Secret laboratory of Fatown has developed a new gluttonous robot which oves on stripe consisting of \textbf{n}+\textbf{1} cells. Cells are numbered from \textbf{0} to \textbf{n}. The robot is located at cell with number \textbf{0}; each other cell contains several bukazoids which gluttonous robot regales oneself with. The robot can do \textbf{m} single jumps (to adjacent cell) and \textbf{k} double jumps (over one cell). Additionally, \textbf{m} +\textbf{ 2k} = \textbf{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. \InputFile The first line at the input contains \textbf{3} integers: \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{100}), \textbf{m} (\textbf{0} ≤ \textbf{m} ≤ \textbf{100}), \textbf{k} (\textbf{0} ≤ \textbf{k} ≤ \textbf{100}). The second line contains \textbf{n} integers -- number of bukazoids (up to \textbf{100}) in corresponding cells of the stripe. \OutputFile The first line at the output should contain highest number of bukazoids found. The second line should contain \textbf{m}+\textbf{k}+\textbf{1} integers -- numbers of cells visited by the robot, starting from cell with number \textbf{0}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
5 1 2
5 2 7 3 1
Output example #1
13
0 1 3 5