#include <iostream>
#include <math.h>
using namespace std;
int main() {
// your code goes here
int t, c=0;
cin>>t;
while(c<t){
long sum;
int a,b;
cin>>a;
cin>>b;
sum=pow((b,2)*pow((b+1),2)))/4 + 3* (b*(2*b+1)*(b+1)))/6 + 2*(b*(b+1)))/2;
sum-=pow((a,2)*pow((a+1),2)))/4 + 3* (a*(2*a+1)*(a+1)))/6 + 2*(a*(a+1)))/2;
cout<<sum%100<<"\n";
sum=0;
c++;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglpbnQgdCwgYz0wOwoJY2luPj50OwoJd2hpbGUoYzx0KXsKCQlsb25nIHN1bTsKCQlpbnQgYSxiOwoJCWNpbj4+YTsKCQljaW4+PmI7CgkJc3VtPXBvdygoYiwyKSpwb3coKGIrMSksMikpKS80ICsgMyogKGIqKDIqYisxKSooYisxKSkpLzYgKyAyKihiKihiKzEpKSkvMjsKCQlzdW0tPXBvdygoYSwyKSpwb3coKGErMSksMikpKS80ICsgMyogKGEqKDIqYSsxKSooYSsxKSkpLzYgKyAyKihhKihhKzEpKSkvMjsKCQljb3V0PDxzdW0lMTAwPDwiXG4iOwoJCXN1bT0wOwoJCWMrKzsKCX0KCXJldHVybiAwOwp9
prog.cpp: In function ‘int main()’:
prog.cpp:14:29: error: no matching function for call to ‘pow(__gnu_cxx::__promote_2<int, int, double, double>::__type)’
sum=pow((b,2)*pow((b+1),2)))/4 + 3* (b*(2*b+1)*(b+1)))/6 + 2*(b*(b+1)))/2;
^
In file included from /usr/include/features.h:364:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:507,
from /usr/include/c++/6/iostream:38,
from prog.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:153:1: note: candidate: double pow(double, double)
__MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:153:1: note: candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/6/math.h:36:0,
from prog.cpp:2:
/usr/include/c++/6/cmath:438:5: note: candidate: template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)
pow(_Tp __x, _Up __y)
^~~
/usr/include/c++/6/cmath:438:5: note: template argument deduction/substitution failed:
prog.cpp:14:29: note: candidate expects 2 arguments, 1 provided
sum=pow((b,2)*pow((b+1),2)))/4 + 3* (b*(2*b+1)*(b+1)))/6 + 2*(b*(b+1)))/2;
^
In file included from /usr/include/c++/6/math.h:36:0,
from prog.cpp:2:
/usr/include/c++/6/cmath:415:3: note: candidate: constexpr long double std::pow(long double, long double)
pow(long double __x, long double __y)
^~~
/usr/include/c++/6/cmath:415:3: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/6/cmath:411:3: note: candidate: constexpr float std::pow(float, float)
pow(float __x, float __y)
^~~
/usr/include/c++/6/cmath:411:3: note: candidate expects 2 arguments, 1 provided
prog.cpp:15:30: error: no matching function for call to ‘pow(__gnu_cxx::__promote_2<int, int, double, double>::__type)’
sum-=pow((a,2)*pow((a+1),2)))/4 + 3* (a*(2*a+1)*(a+1)))/6 + 2*(a*(a+1)))/2;
^
In file included from /usr/include/features.h:364:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:507,
from /usr/include/c++/6/iostream:38,
from prog.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:153:1: note: candidate: double pow(double, double)
__MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:153:1: note: candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/6/math.h:36:0,
from prog.cpp:2:
/usr/include/c++/6/cmath:438:5: note: candidate: template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)
pow(_Tp __x, _Up __y)
^~~
/usr/include/c++/6/cmath:438:5: note: template argument deduction/substitution failed:
prog.cpp:15:30: note: candidate expects 2 arguments, 1 provided
sum-=pow((a,2)*pow((a+1),2)))/4 + 3* (a*(2*a+1)*(a+1)))/6 + 2*(a*(a+1)))/2;
^
In file included from /usr/include/c++/6/math.h:36:0,
from prog.cpp:2:
/usr/include/c++/6/cmath:415:3: note: candidate: constexpr long double std::pow(long double, long double)
pow(long double __x, long double __y)
^~~
/usr/include/c++/6/cmath:415:3: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/6/cmath:411:3: note: candidate: constexpr float std::pow(float, float)
pow(float __x, float __y)
^~~
/usr/include/c++/6/cmath:411:3: note: candidate expects 2 arguments, 1 provided