Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <string>
- using namespace std;
- int main(){
- int t; cin>>t;
- while(t>0){t--;
- double l,r; cin>>l>>r;
- double sum=(r-l+1)*((r+l)/2);
- cout<<(long long)sum<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment