Submit | All submissions | Best solutions | Back to list |
DLVASCIS - Arab Cleaning Masters |
-ACM- Arab Cleaning Masters is a famous company established in 1994. It’s one of the most known cleaning companies that clean houses, cafes, restaurants, etc...
ACM workers love their company a lot that’s why it’s famous. ACM has a very simple hierarchy divided into workers (cleaners) and a manager all of them get their salary monthly.
The manager sent three workers to clean a house near Abasyya. Each worker should work 2 hours. The problem is that the third worker was very tired and had to go to the hospital. So, the others (the remaining 2 workers) decided to do his job.
The first person worked 3 hours and the second worked 3 hours, the manager came to see their work. He was impressed and happy because the job was perfectly done. So, he decided to give them 80 Dollars as a gift.
Now, the 2 workers want to share this 80 Dollars fairly. So, after some calculations they found that both of them will take 40 Dollars.
Now the manager wants to automate this process, how?!
He asks you to make a program that calculates this gift fairly between workers.
Note:
Regardless the number of absent workers, the job must completely be finished.
Input
Your program will be tested on one or more test cases. The first line of input will be a single integer T, For each test case, print "Case_#i:_X" where "X" is the Pth worker’s share of the given gift G (The answer should be formatted and approximated to three decimal places as shown in sample output), "i" is the number of the test case (starting with 1) and "_" is a white space. Each output should be printed in a separate line.
The number of test cases (1<=T<=20). Each test case starts with two integers N (1
Each test case ends with 2 integers G (0<=G<1000) (given gift) and P (0<=iOutput
Example
Input:
2
3 2
1
3 3 0
80 1
3 6
1
9 0 9
120 0
Output:
Case #1: 40.000
Case #2: 60.000
Added by: | Mohamed Ali |
Date: | 2014-01-14 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | acmASCIS Level 1 Contest 2014 |