https://codeforces.com/contest/1354/problem/A

https://codeforces.com/contest/1354/problem/A
This is the question
https://codeforces.com/contest/1354/submission/80791237
This is my solution but last test case is not running

You should declare all the variables as long, to avoid overflow.

1 Like