Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int a,b,c,d,L,res;
- while(scanf("%d%d%d%d%d",&a,&b,&c,&d,&L)==5)
- {
- if(a==0&&b==0&&c==0&&d==0&&L==0)
- {
- return 0;
- }
- int countt=0;
- for(int i=0; i<=L; i++)
- {
- res=(a*i*i)+(b*i)+c;
- if(res%d==0)
- {
- countt++;
- }
- }
- printf("%d\n",countt);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement