UVA 1230 - MODEX Shipu Ahamed - 31 Aug 2020 Problem PDFSolution:#include int main() { long long t,x,y,m,r; scanf("%lld",&t); while(t--) { scanf("%lld %lld %lld",&x,&y,&m); r=1; while(y) { if(y%2!=0) r=(r*x)%m; x=(x*x)%m; y/=2; } printf("%lld\n",r); } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/1230/1230.cpp