Saleh127

Spoj NDIV

Jul 6th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9. int a,c,d,e,f=0,i,j,k,l;
  10. scanf("%d %d %d",&a,&c,&d);
  11. for(i=a;i<=c;i++)
  12. {
  13. e=0;
  14. for(j=1;j*j<=i;j++)
  15. {
  16. if(i%j==0)
  17. {
  18. if(j*j<i) e+=2;
  19. else e++;
  20. }
  21. }
  22. if(e==d) f++;
  23. }
  24. printf("%d\n",f);
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment