Hello everybody,
I want do a question:
In the second recovery homework we have that, in a certain moment, a specific client can have debts with both of intermediates. These debts can be the same quantity and in this moment we want divide the amount of the client in two parts. I want remember that if we have this case, we can't pay both of intermediates, but only one of them or both of them (but can't expire all of the amount of debts). Now if the client has a even quantity of money, we haven't problems, in fact if we have:
amount = 1000
debt_first_intermediate = 600
debt_second_intermediate = 600
we can't pay both of intermediates and with the intermediates have same debt. So we pay 50% of first intermediate ed 50% of second intermediate and the situation become:
amount = 0
debt_first_intermediate = 100
debt_second_intermediate = 100
We pay 500 to first intermediate and 500 to second intermediate (equal debts)
But if we have the following situation:
amount = 1099
debt_first_intermediate = 600
debt_second_intermediate = 600
We can't pay both of intermediates at the same way and we have an amount of client that is odd... In this case how divide the amount of the client to pay the two intermediates (with same debt). I pass all of the normal test with my implementation, but i don't know if secret test can have this situation and how my alghorithm can work of this case... I can't do float operations because the exercise speaks of only integer values and i don't think that i can do float operation or maybe approssimation.
How can interpretate this case or can i suppose that this case doesn't appear ??
Thanks everybody !!
P.S.: I hope that i was clear and that my english is good