Tickets

No attempts yetTime limit1sMemory limit128 MB

Problem

The Hellenic Broadcasting Company (HBC) broadcasts $L$ equal-size teletext pages carrying railway-ticket information over $D$ channels. Each page has a popularity — the probability that a viewer wants to read it. Let $p_i$ denote the popularity of page $i$. The popularities are given in non-increasing order and sum to $1$.

Pages receive an Internal Code (IC) from $1$ to $L$ assigned by decreasing popularity, so page $1$ is the most popular and page $L$ the least. Every channel serves a contiguous range of ICs:

  • channel $1$ serves pages $[1, M_1]$,
  • channel $2$ serves pages $[M_1 + 1, M_2]$,
  • $;\dots$
  • channel $D$ serves pages $[M_{D-1} + 1, L]$,

with $1 \le M_1 < M_2 < \dots < M_D = L$, so every channel serves at least one page.

Within a channel the pages are broadcast cyclically (round-robin) in order of decreasing popularity: a channel holding pages $A, B, C$ broadcasts $A, B, C, A, B, C, \dots$. The delay $d_i$ of page $i$ is its $1$-based position in its channel's broadcast order — the most popular page of a channel has delay $1$, the next $2$, and so on.

Minimize the average delay $$\sum_{i=1}^{L} p_i , d_i .$$ Since the popularities sum to $1$, this equals the popularity-weighted average viewing delay.

Given $D$, $L$, and every page's popularity, choose $M_1, \dots, M_D$ that minimize the average delay and report the largest IC served by each channel.

Input

The first line contains an integer $D$, the number of channels ($1 \le D \le 20$).

The second line contains an integer $L$, the number of pages ($1 \le L \le 300$, with $D \le L$).

Each of the next $L$ lines contains one real number in $[0, 1]$: the popularity of a page. The values are listed in non-increasing order.

Output

Print $D$ lines. Line $j$ contains the integer $M_j$, the largest IC (page number) served by channel $j$, for the channel assignment that minimizes the average delay.

If several assignments achieve the minimum, output the one whose sequence $M_1, M_2, \dots, M_D$ is lexicographically smallest.