Optimization is Freaky Fun
Time limit2sMemory limit256 MB
For each query with N, S, and E up to 10^12, print the value that Kyojun's program outputs.
- Level
Medium4 of 10
- Topics
- Math, Number theory
- Solved
- No attempts yet
Problem
The following is the source code written by Kyojun.

<Figure 1> Source code written by Kyojun
The input of the program written by Kyojun is as follows:
Q
N1 S1 E1
N2 S2 E2
...
NQ SQ EQ
Write a program that prints the output of the program written by Kyojun.
Input
The first line contains a natural number .
The -th line contains three natural numbers , , and , separated by spaces ().
Output
From the first line to the -th line, print the output of the program written by Kyojun.
Constraints
All input data satisfy the following conditions.
- ()
- ()
- ()