WA in EXPGCD

https://www.codechef.com/viewsolution/26479707
Can anyone help me to find out , why am I getting WA in basic subtask .
Thanks in Advance .