Miraculous Drug

Each hour uses the cheapest enzyme bought within the last h hours, breaking ties toward the latest hour, and reports purchase counts over a given interval.

Medium4Sliding windowQueueInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

Joe is a biomedical researcher. He is close to a cure for a terrible disease. Making the drug requires a special enzyme that is expensive and loses its properties after a fixed time. The clinical trial phase needs one dose of the drug every hour, and one dose takes one enzyme.

Prices are given for the next nn hours. At hour ii Joe can buy any number of enzymes at price cic_i each. An enzyme lives for hh hours, so an enzyme bought at hour ii can be used at hours ii through i+h1i + h - 1. Joe uses one enzyme at each of the hours 11 through nn. Find the plan with the smallest total cost.

When prices tie, Joe buys the fresher enzyme instead of stocking one early. That fixes a single plan: the enzyme used at hour ii is bought at the cheapest hour of the interval [max(1, ih+1), i][\max(1,\ i - h + 1),\ i], and if several hours are cheapest, at the latest of them.

Input

The input holds several data sets and ends at end of file. Each data set holds the number of hours nn, the enzyme lifetime hh, the first hour bb and the last hour ee of the printing interval, and then the prices c1,c2,,cnc_1, c_2, \dots, c_n, in that order. White space and line breaks may appear freely between numbers.

  • 1n<100001 \le n < 10000
  • 1h<100001 \le h < 10000
  • 1ben1 \le b \le e \le n
  • 0ci<100000 \le c_i < 10000

Output

For each data set print one line, starting at the beginning of the line, with the number of enzymes Joe buys at each of the hours bb through ee, separated by tab characters.