Chef Loves Cakes Problem Code: ECAUG201
can please someone figure out what is wrong with the code in the mentioned problem of contest Encoding August’20
can please someone figure out what is wrong with the code in the mentioned problem of contest Encoding August’20
dude, share the submission link
Your N * M will overflow for large values of N and M. Take long long.
You are using int
for n
and m
, so the expression n * m
overflows, even though you store the final result in a long
.
Consider the test input:
1
9999976 9999976
You have used int for n and m. Change it to long long.