Finally AC!!!

change float(A / B) to float(A) / float(B),
everything will be fine. :D