原文:
Teamwork
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.
输入:
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.
输出:
One line contains several integers, indicating the indexes of selected candidates.
样例输入:
4 2 -1 4 -2 1 1
样例输出:
2 3 4
译文:
团队
1000ms 65536K
描述:
有N个候选者。每个候选人都有一个合作价值和一个工作价值。选择一个该候选人子集组成一个团队,使组成团队的合作价值之和为正,工作价值之和最大。
输入:
第一行包含一个正整数N(N <= 100)
接下来的N行,每行包含两个整数,范围在-100~100之间,分别用来代表每一个候选人的合作加价值和工作价值
输出:
依次输出候选人的编号(次序),两个编号之间用一个空格隔开
样例输入:
4 2 -1 4 -2 1 1
样例输出:
2 3 4