QOJ.ac

QOJ

Límite de tiempo: 4.0 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓

#14411. King, Joker, and Divisibility

Estadísticas

国王让小丑回答 $q$ 个如下形式的询问:

给定三个整数 $\ell_i$、$r_i$ 和 $k_i$。求第 $k_i$ 小的正整数 $x$,满足 $x$ 不能整除 $\ell_i$ 到 $r_i$(包含端点)中的任何一个整数。

输入格式

输入的第一行包含一个整数 $q$ ($1 \le q \le 10^5$)。

接下来的 $q$ 行,每行包含一个询问,由三个整数组成:$\ell_i$、$r_i$ 和 $k_i$ ($1 \le \ell_i \le r_i \le 2 \cdot 10^5$,$1 \le k_i \le 2 \cdot 10^5$)。

输出格式

对于每个询问,输出一个整数:该询问对应的 $x$ 的值。

样例

输入样例 1

3
10 11 5
12345 23456 789
1 200000 200000

输出样例 1

8
23629
400000

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.