Getting WA in DYNAMO (Interactive problem)

I am getting WA in DYNAMO Problem of January Long challenge . This is my first interactive problem and I am unable to find where my error is. please help me in finding error in my code. My code is linked below: https://www.codechef.com/viewsolution/30859322

In my code **I have defined endl as ‘\n’ **

No. You’ve defined endl as ‘\n’

Sorry that was basic english problem.

Also your S seems to be wrong. It should be A+2*10^n

Thanks. I missed the constraint that numbers can not be equal to 10^n. i have updated my code but it is again giving wa.
https://www.codechef.com/viewsolution/30860281

What does cout.tie(0); do?
Also the inbuilt pow is horrible, just precompute the powers of 10.
https://www.codechef.com/viewsolution/30860895

1 Like

Thanks for your help