原题:
You have a certain amount of money to give out as a bonus to employees. The trouble is, who do you pick to receive what bonus? You decide to assign a number of points to each employee, which corresponds to how much they helped the company in the last year. You are given an vector <int> points, where each element contains the points earned by the corresponding employee (i.e. points[0] is the number of points awarded to employee 0). Using this, you are to calculate the bonuses as follows: - First, add up all the points, this is the pool of total points awarded. The return value should be a vector <int>, one element per employee in the order they were passed in. Each element should be the percent of the bonus that the employee gets. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | points will have between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of points will be between 1 and 500, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
|