• 应用
• 登录
• 注册

# P3486 [POI2009]KON-Ticket Inspector

• 9通过
• 20提交
• 题目提供者洛谷OnlineJudge
• 标签 动态规划,动规,dp POI 2009 高性能
• 难度 普及/提高-
• 时空限制 1s / 128MB
• 提示：收藏到任务计划后，可在首页查看。

## 题目描述

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 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.

有n个车站，现在有一辆火车从1到n驶过，给出aij代表从i站上车j站下车的人的个数。列车行驶过程中你有K次检票机会，所有当前在车上的人会被检票，问最多能检多少个不同的人的票

## 输入输出格式

输入格式：

In the first line of the standard input two positive integers and (, ) 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 to in the order of appearance on the route.

In the next lines the summary on passengers is given. The -th line contains information on the passengers who enter the train on the station - it is a sequence of ![](http://ma

输出格式：

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

## 输入输出样例

输入样例#1： 复制
7 2
2 1 8 2 1 0
3 5 1 0 1
3 1 2 2
3 5 6
3 2
1

输出样例#1： 复制
2 5

提示
标程仅供做题后或实在无思路时参考。
请自觉、自律地使用该功能并请对自己的学习负责。
如果发现恶意抄袭标程，将按照I类违反进行处理。