UVA 11934 - Magic Formula UVA • Sep 1, 2020 Problem PDFSolution:#include int main() { long long f,i,k,a ,b ,c ,d ,L; while(scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&L)==5) { if(a==0&&b==0&&c==0&&d==0&&L==0) break; k=0; for(i=0;i<=L;i++) { f=(i*i*a)+(i*b)+c; if(f%d==0) k++; } printf("%lld\n",k); } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11934/11934.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read