#include<cstdio> #include<cmath> using namespace std; int main() { int a,b,c,d,l,cnt; while (scanf("%d%d%d%d%d",&a,&b,&c,&d,&l)==5) { if (!a && !b && !c && !d && !l) return 0; cnt=0; for (int i=0;i<=l;i++) if ((a*i*i+b*i+c)%d==0) cnt++; printf("%d\n",cnt); } return 0; }
Tuesday, July 19, 2016
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment