제출 #977006

#제출 시각아이디문제언어결과실행 시간메모리
977006vjudge1Trol (COCI19_trol)C++17
50 / 50
1 ms600 KiB
#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main(){
    int q;
    cin>>q;
    while (q--){
        ll l,r;
        cin>>l>>r;
        ll a=(r-l+1)/9;
        ll b=a*45;
        for (ll c=l+9*a;c<=r;c++)b+=(c+8)%9+1;
        cout<<b<<'\n';
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...