Advertisement
saira12tabassum19

Untitled

Dec 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int t;
  7. cin>>t;
  8. for (int h=1;h<=t;h++)
  9. {int n,m;
  10. long long int l,r;
  11. map<long long int,long long int>ma;
  12. cin>>n>>m>>l>>r;
  13. for(int i=l;i<=r;i++)
  14. {
  15. for(int j=n;j<=m;j++)
  16. {
  17. if(i%j==0)ma[j]=ma[j]+i;
  18. }
  19. }
  20. cout<<"Case #"<<h<<": ";
  21. for(int k=n;k<=m;k++){cout<<ma[k]<<' ';}
  22. cout<<endl;}
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement