제출 #1341691

#제출 시각아이디문제언어결과실행 시간메모리
1341691inimadTrol (COCI19_trol)C++20
10 / 50
0 ms344 KiB
#include<bits/stdc++.h>
using namespace std;

#define LL long long

int main() {
    ios::sync_with_stdio(0), cin.tie(0);
    
    int q;
    cin >> q;

    while(q--){
        int l, r;
        cin >> l >> r;
        l--;
        cout << (r * (r + 1)) / 2 - (l * (l+1)) / 2 <<'\n';
    }    
}
#Verdict Execution timeMemoryGrader output
Fetching results...