Jubeat

아직 제출이 없습니다시간 제한4초메모리 제한1024 MB

문제

Recently, Nana is spending a lot of time playing “Jubeat”, the latest arcade music game from Konami. The game consists of a 4×44 \times 4 grid. When a note pops up in some of the cells, the player must push that cell following the rhythm of the music.

For each note pushed, the player is awarded points. If a song contains NN notes, a player will receive 900,000N\frac{900\\,000}{N} points if the timing of the push is perfect. For notes where the timing was less perfect, she can receive either 7070%, 3030%, or 00% of this score. After the song is over, the sum of all the points will be rounded down to the nearest integer.

Nana just played a song and received a score of SS: however he doesn’t know the number of notes NN in the song. However, he suspects NN lies in an interval \[a,b]\[a, b]. Write a program that calculates the sum of all possible NNs in that range.

입력

The input consists of TT test cases. The number of test cases TT is given in the first line of the input. Each test case consists of a single line with three integers: SS (0S900,0000 ≤ S ≤ 900\\,000), aa and bb (1ab1091 ≤ a ≤ b ≤ 10^9).

출력

Print exactly one line for each test case. The line should contain an integer indicating the sum of all possible NN in the given range.