MArbrl question is not submitting

i have written the code same as told in the hint but i am not getting AC. Please check my code
Here is my code :

Please help me with this.

The answer can overflow ll int that’s why your code is not passing test cases.

what can do to prevent overflow … please help me just

Use Bigint class of c++.
Refer this -: