#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
long long int a,b;
while(t>0)
{
long long int sum=0;
cin>>a>>b;
long long int dif=b-a;
int pm=a%9;
sum=(dif/9)*45;
int mod=b%9;
if(mod==0)
{
mod=9;
}
for(int j=pm; j<=mod; j++)
{
if(j==0)
{
sum=sum+9;
}
sum=sum+j;
}
cout<<sum<<endl;
t--;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
11 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
3 ms |
256 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
256 KB |
Output isn't correct |
5 |
Incorrect |
3 ms |
256 KB |
Output isn't correct |