| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 1024 MB | 53 | 8 | 3 | 50.000% |
Determine whether there exists a sequence of $N$ nonnegative integers $a_1,a_2,\cdots,a_N$ that satisfies all of the following conditions, and if it exists, find the minimum possible value of the maximum of the array.
Note that there are $T$ tests in one input file.
Input is given from Standard Input in the following format:
$T$
$N_1$ $S_1$ $X_1$
$N_2$ $S_2$ $X_2$
$\vdots$
$N_T$ $S_T$ $X_T$
Here, $N_i,S_i,X_i$ represent values of $N,S,X$ for the $i$-th test, respectively.
Print $T$ lines. In the $i$-th line, print $-1$ if there doesn't exist an array with the mentioned property in the $i$-th test, and print the minimum possible value of the maximum of the array if it exists.
6 3 9 3 4 8 0 6 19 1 1 15 15 2 6 5 5 4 3
3 2 4 15 -1 -1
The following is a solution for each test: