| 2015 PSUT Coding Marathon |
|---|
| Finished |
Mr. Ahmad found that in some cases, it is impossible to satisfy everyone. Therefore, some individuals might be assigned to teams.
There are K PCs available at the IT labs, which may be prepared for 1, 2 or 3 students. Find the minimum possible number of unsatisfied students.
The input contains 3 space-separated integers: N M K, where:
N is the number of students who don’t mind to participate individually or in a team of 2 or 3 members.
M is the number of students who chose to participate individually.
K is the number of available PCs in the IT Labs.
All integers are between 0 and 1,000,000,000 (inclusive).
If K PCs are not enough to allow everyone to participate, print -1, otherwise print the minimum number of unsatisfied students.
4 8 8
2
8 5 3
-1
6 3 6
0
| Name |
|---|


