Problem Statement: Three Families
Explanation
Let's do a simple simulation from the problem statement to get a better problem understanding. Family A spent 5 hours and family B spent 4 hours to finish the job, so total hours needed to finish the job is 9 hours. Divide the total hours by 3 and result is 9 / 3 = 3. So normally every family must do 3 hours to finish the job.
Because family A do 5 hours job, it means family A do 5 - 3 = 2 extra hours. Meanwhile family B do 1 extra hours. To calculate money that family A get (2 / (2 + 1)) * 90 = 60.
Source Code
Tidak ada komentar:
Posting Komentar