Logo
(追記) (追記ここまで)

28485번 - Conditionally rich numbers 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.18 초 1024 MB44141028.571%

문제

Mariya has come up with the following definition for a rich number. It is given a positive integer $X$. Then a positive integer $N$ is called a rich number (relative to $X$) if the sum of its divisors except $N$ is greater than $X$. For example, the number 10ドル$ (whose sum of divisors is 1ドル+2+5 = 8$) is rich relative to $X=7$ but it isn’t rich relative to $X=12$.

Write a program rich_num to help Mariya. The program will be given queries that are ordered triples of positive integers $(L, R, V)$ and for each query it should calculate the number of rich numbers relative to $V,ドル which are greater than or equal to $L$ and less than or equal to $R$.

입력

The first line of the standard input contains one positive integer $Q$ – the number of queries that your program has to process.

Each of the next $Q$ lines contains three positive integers $L,ドル $R$ and $V,ドル which describe a query for your program to process.

출력

Your program should output to the standard output $Q$ lines – one line for each query in the order of the input. Each line should contain the answer to the corresponding query.

제한

  • 1ドル ≤ Q ≤ 10^5$
  • 1ドル ≤ L ≤ R ≤ 10^5$
  • 1ドル ≤ V ≤ 10^5$

서브태스크

번호배점제한
15

$Q \le 10^3,ドル $R \le 10^3,ドル $V \le 10^5$

210

$Q \le 10^5,ドル $R \le 10^4,ドル $V = 10$

330

$Q \le 10^5,ドル $R \le 10^5,ドル $V \le 10$

455

$Q \le 10^5,ドル $R \le 10^5,ドル $V \le 10^5$

예제 입력 1

3
5 15 5
1 20 20
12 20 10

예제 출력 1

6
2
4

힌트

출처

Olympiad > International Autumn Tournament in Informatics > 2022 > Group B (Juniors) 3번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /