#P10782. 【MX-J1-T2】『FLA - III』Ilumina
【MX-J1-T2】『FLA - III』Ilumina
Background
Original problem link: https://oier.team/problems/J1B.
Problem Description
Define as the greatest integer less than or equal to . For example, .
There are five positive integers , and it is known that , .
Given the values of and , find a valid value of , or report that no valid value of exists.
This problem uses a custom checker. If multiple valid values of exist, output any one of them.
Input Format
This problem contains multiple test cases.
The first line contains a positive integer , the number of test cases.
For each test case, input one line with two positive integers .
Output Format
For each test case, output one integer on a single line. If no valid value of exists, output -1; otherwise output a valid value of .
This problem uses a custom checker. If multiple valid values of exist, output any one of them.
4
1 1
7 3
23 8
17 23
1
3
-1
-1
Hint
"Sample Explanation #1"
For the first test case, choosing yields .
For the second test case, choosing yields .
For the third and fourth test cases, it can be proven that no valid value of exists.
Constraints
| Test Point ID | Special Property | |
|---|---|---|
| None | ||
| Yes | ||
| None |
Special property: It is guaranteed that for each given , a valid value of always exists.
For of the testdata, , .
July 15, 2024: Added 7 hack testdata cases to Subtask #1.
Translated by ChatGPT 5