#P15739. [JAG 2024 Summer Camp #2] K-th Nondivisor
[JAG 2024 Summer Camp #2] K-th Nondivisor
题目描述
Process queries. The -th query is as follows:
- Given integers , , and , find the -th smallest positive integer such that does not divide any of the integers from to (inclusive).
输入格式
The input is given in the following format:
$$\begin{aligned} &Q \\ &L_1 \ R_1 \ K_1 \\ &\vdots \\ &L_Q \ R_Q \ K_Q \end{aligned} $$- All input values are integers.
输出格式
Output lines. On the -th line, output the answer for the -th query.
3
10 11 5
12345 23456 789
1 200000 200000
8
23629
400000