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

This is the question

This is my solution but last test case is not running

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

1 Like