Question-

My solution-

https://www.codechef.com/viewsolution/18994958

Read the question properly. There are total n moves and A uses n/2 of these moves and B n/2. If n is odd then A gets one more move than B as he starts first

```
a=a*pow(2,(n/2));
b= b*(pow(2,(n/2)));
```

One word. Overflow. Please instead of calculating exactly whats asked, try and see if this fraction can be reduced into a prettier/easy/simpler form.

Got your point. But still not getting AC for subtask 2. Should i change my approach to the question?

New Solution -

https://www.codechef.com/viewsolution/18995343

Sorry i didnâ€™t see the constraints earlier. Try what vijju said.