Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

3974.   Calculate
Time Limit: 1.0 Seconds   Memory Limit: 65536K
Total Runs: 868   Accepted Runs: 281

We have a formula

S_m(n)=1m + 2m + ... + nm

Now, you will get several inputs. Each input has two numbers n,m. Please output the last two digits of S_m(n).


The first line of the input is an integer T which is the sum of test case. Then there are T lines following. Each line contains two integers, the first integer is n(10≤n≤1000) and the second is m(10≤m≤1000000).

Output There will be T lines in the output. For each test case, output the last two digits of S_m(n).

Sample Input

10 10
10 1000000
234 234

Sample output


Source: TJU Team Selection 2013
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz