#include <bits/stdc++.h>
using namespace std;
long long q, l, r, ans,
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> q;
while(q--)
{
ans = 0;
cin >> l >> r;
if((r - l + 1) % 9 == 0)
{
ans = (r - l + 1) * 5;
cout << ans << "\n";
}
else
{
ans = (r - l + 1) / 9 * 45;
long long t = (r - l + 1) % 9;
while(t--)
{
if(l % 9 == 0)
{
ans += 9;
}
else
{
ans += l % 9;
}
++l;
}
cout << ans << "\n";
}
}
}
Compilation message
trol.cpp:6:1: error: expected unqualified-id before 'int'
6 | int main()
| ^~~