아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Jubeat

시간 제한4초메모리 제한1024 MB

요약
점수 S가 주어질 때, [a,b] 구간의 노트 수 N 중에서 달성 가능한 내림 점수의 최댓값이 S가 되는 모든 N의 합을 구한다.
난이도

보통10점 중 6점

유형
수학, 정수론, 완전 탐색
정답자
아직 제출이 없습니다

문제

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 (0≤S≤900,0000 ≤ S ≤ 900\\,000), aa and bb (1≤a≤b≤1091 ≤ 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.

예제1

  1. 예제 1

    입력
    2
    128571 1 10
    450000 11 20
    
    예상 출력
    7
    155