CF1316E Team Building

题目描述

你需要组建一支排球队。为了组织一支排球队,你需要为队伍里的$p$个不同的位置,从$n$个人中选出$p$个人,且每个位置上都恰好有一个人。另外还需要从剩下的人中选出恰好$k$个人作为观众。 对于第$i$个人,已知他作为观众时能为队伍增加$a_i$点力量,还有他在队伍的第$j$个位置上时能为队伍增加$s_{i,j}$点力量。请问这只排球队力量的最大值是多少?

输入格式

输出格式

说明/提示

In the first sample, we can select person $ 1 $ to play in the $ 1 $ -st position and persons $ 2 $ and $ 3 $ as audience members. Then the total strength of the club will be equal to $ a_{2}+a_{3}+s_{1,1} $ .