Getting wrong answer in Not So Easy Math problem

Question - https://hack.codingblocks.com/contests/c/126/821
My Code - https://ide.codingblocks.com/#/s/25846

Please reply…anyone