Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Doubt for [HW2rec]

G
Giordano_Dionisi (3100 points)
17 41 59
in HW2 2nd chance by (3.1k points)

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 smiley

1 Answer

by (2.8k points)
Dear Mr Dionisi,

Thank you for your thorough and well-documented question. Please feel free to assume that the situation you depict is not going to occur – namely, there is not going to be an uneven payment of debts due to an odd amount in the balance, not even in the secret tests.

With kind regards,
CDC
G
Giordano_Dionisi (3100 points)
17 41 59
by (3.1k points)

Perfect perfect prof, now i can stay very relaxed.... 

Thanks really a lot and i wish you a nice day !!! laugh