Hey! My code to answer the question in my opinion looks reasonable and the logic is hopefully great. But I am still receiving a Wrong Answer mark from Code Chef. If someone were able to help me I would be very appreciating.
Here’s my code:
X = input()
X1 = X.split(’ ')
withdraw = float(X1[0])
total = float(X1[1])
if (float(withdraw)%5 == 0 and float(withdraw) < total):
total = total - float(withdraw) - 0.50
formatted_float = “{:.2f}”.format(total)
print(formatted_float)
elif (float(withdraw)%5 != 0 and float(withdraw) < total):
formatted_float = “{:.2f}”.format(total)
print(formatted_float)
else:
formatted_float = “{:.2f}”.format(total)
print(formatted_float)