Getting "Wrong answer" while submitting the code.

What is the problem in my code? I am getting wrong answer while submitting the code.

my problem:
my solution:

Hi arvindlearner,
the problem statement says:

Output the account balance after the attempted transaction, given as a number with two digits of precision. If there is not enough money in the account to complete the transaction, output the current bank balance.

So check for example the input

5 5.1

Your program returns -0.4, which should not be possible.