Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- cin>>t;
- for (int h=1;h<=t;h++)
- {int n,m;
- long long int l,r;
- map<long long int,long long int>ma;
- cin>>n>>m>>l>>r;
- for(int i=l;i<=r;i++)
- {
- for(int j=n;j<=m;j++)
- {
- if(i%j==0)ma[j]=ma[j]+i;
- }
- }
- cout<<"Case #"<<h<<": ";
- for(int k=n;k<=m;k++){cout<<ma[k]<<' ';}
- cout<<endl;}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement