Advertisement
noshin98

uva 11934

Jul 10th, 2016
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     long long a,b,c,d,l,i,k,f;
  5.     while(scanf("%lld%lld%lld%lld%lld",&a,&b,&c,&d,&l)==5)
  6.     {
  7.         if(a==0&&b==0&&c==0&&d==0&&l==0)
  8.             break;
  9.  
  10.         k=0;
  11.         for(i=0;i<=l;i++)
  12.         {
  13.             f=(i*i*a)+(i*b)+c;
  14.             if(f%d==0)
  15.                 k++;
  16.  
  17.         }
  18.         printf("%lld\n",k);
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement