a = 15511210043330985984000000 # (25!)
b = 479001600 # (12!)
c = 6227020800 # (13!)
On dividing ans = int(a/(b*c))
or ans = int((a/b)/c)
we get ans
equal to 5200299
instead of 5200300
In Python 3.x /
means floating point division and can give small rounding errors. Use //
for integer division.
ans = a // (b*c)
Try using integer division instead of float division.
>>> 15511210043330985984000000 / (479001600 * 6227020800)
5200299.999999999
>>> 15511210043330985984000000 // (479001600 * 6227020800)
5200300
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With