시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
5 초 | 512 MB | 43 | 28 | 27 | 75.000% |
You work for a company that has E employees working in town T. There are N towns in the area where the employees live. You want to ensure that everyone will be able to make it to work. Some of the employees are drivers and can drive P passengers. A capacity of P == 1
indicates that the driver can only transport themselves to work. You want to ensure that everyone will be able to make it to work and you would like to minimize the number of cars on the road.
You want to calculate the number of cars on the road, with these requirements:
Find whether it is possible for everyone to make it to work, and if it is, how many cars will end up driving to the office.
One line containing an integer C, the number of test cases in the input file.
For each test case there will be:
E
lines, one for each employee, each containing:
Limits
3 5 1 3 1 0 1 0 1 0 5 1 3 2 4 2 0 3 0 5 3 5 1 2 1 0 4 2 4 4 4 0
Case #1: 0 0 0 0 0 Case #2: IMPOSSIBLE Case #3: 1 0 0 1 0
Contest > Google > Google's Coding Competitions > Google Code Jam Africa 2010 > Online Competition B1번