QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 32 MB Total points: 100

#589. Ticket Inspector

الإحصائيات

Byteasar works as a ticket inspector in a Byteotian National Railways (BNR) express train that connects Byteburg with Bitwise. The third stage of the BNR reform (The never ending saga of BNR reforms and the Bitwise hub was presented in the problems Railway from the third stage of XIV Polish OI and Station from the third stage of XV Polish OI. Their knowledge, however, is not required at all in order to solve this problem.) has begun. In particular, the salaries system has already been changed. For example, to encourage Byteasar and other ticket inspectors to efficient work, their salaries now depend on the number of tickets (passengers) they inspect. Byteasar is able to control all the passengers on the train in the time between two successive stations, but he is not eager to waste his energy in doing so. Eventually he decided he would check the tickets exactly $k$ times per ride.

Before setting out, Byteasar is given a detailed summary from which he knows exactly how many passengers will travel from each station to another. Based on that he would like to choose the moments of control in such a way that the number of passengers checked is maximal. Obviously, Byteasar is not paid extra for checking someone multiple times - that would be pointless, and would only disturb the passengers. Write a programme that will determine for Byteasar when he should check the tickets in order to maximise his revenue.

Input

In the first line of the standard input two positive integers $n$ and $k$ ($1 ≤ k < n ≤ 600$, $k ≤ 50$) are given. These are separated by a single space and denote, respectively, the number of stations en route and the number of controls Byteasar intends to make. The stations are numbered from $1$ to $n$ in the order of appearance on the route.

In the next n-1 lines the summary on passengers is given. The $(i+1)$-th line contains information on the passengers who enter the train on the station $i$ - it is a sequence of n-i nonnegative integers $x_{i,i+1},x_{i,i+2},…,x_{i,n}$separated by single spaces. The number $x_{i,j}$ (for $1 ≤ i < j ≤ n$) denotes the number of passengers who enter the train on station $i$ and leave it on station $j$. The total number of passengers (i.e. the sum of all $x_{i,j}$) does not exceed $2\,000\,000\,000$.

Output

Your programme should print out (in a single line) an increasing sequence of $k$ integers from the interval from $1$ to $n-1$ separated by single spaces to the standard output. These numbers should be the numbers of stations upon leaving which Byteasar should control the tickets.

Example

Input

7 2
2 1 8 2 1 0
3 5 1 0 1
3 1 2 2
3 5 6
3 2
1

Output

2 5

In both cases Byteasar controls 42 tickets.

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.