| Codeforces Round 1083 (Div. 2) |
|---|
| Finished |
Simons has given you two integers $$$n$$$ and $$$m$$$.
Count the number of ordered tuples $$$(i, j, k)$$$, such that:
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The only line contains two integers $$$n$$$ and $$$m$$$ ($$$1\le n\le 10^9$$$, $$$1\le m\le 3\cdot 10^5$$$) — the given integers.
It is guaranteed that the sum of $$$m$$$ over all test cases does not exceed $$$3\cdot10^5$$$.
For each test case, output a single integer — the number of ordered tuples $$$(i,j,k)$$$ that satisfy the condition.
53 24 61 17 20720 2025
18254655587864357450
In the first test case, there are $$$18$$$ tuples that satisfy the conditions. For example:
| Name |
|---|


