Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- long long a,b,c,d,l,i,k,f;
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement