Teamwork
https://acs.jxnu.edu.cn/problem/NOIOPJENGLISH21
1000ms 65536K
描述:
There are N candidates. Each candidate has a cooperation value and a working value. Select a subset of candidates to form a team, such that the sum of cooperation values is positive and the sum of working values is maximum.
有n位候选人,每个候选人有一个合作值和一个工作值,在候选人队伍中挑选一个子集,使他们的合作值为正,工作值最大
输入:
First line: one positive integer N (N <= 100).
Next N lines: the i-th line contains two integers (between -100 and 100), indicating the cooperation value and the working value of the i-th candidate.
第一行:一个正整数表示n
接下来n行:第i行包含两个整数,表示第i个候选人的合作值和工作值
输出:
One line contains several integers, indicating the indexes of selected candidates.
一行包含数个数表示候选人的序号
样例输入:
4 2 -1 4 -2 1 1
样例输出:
2 3 4