Same Segment
시간 제한1초메모리 제한1024 MB
M개의 구간이 주어질 때, 각 구간의 합이 모두 K가 되는 0 이상 K 이하 값의 수열이 존재하는지 판정하고, 존재하면 하나를 출력한다.
문제
You have a sequence of integers between and inclusive. segments are given, where th segment is . We want to satisfy for every segment. Determine whether there exists such sequence .
입력
Each test data contains one or more test cases. The first line contains an integer — the number of test cases for this input file.
First line of each test case contains integers , , .
-th of the next lines contain two integers and : left and right end of -th segment.
출력
For each test case, if a sequence that satisfies the condition exists, output the elements of the sequence. In case of multiple answers you may output any of them.
If no valid sequence exists, output a single integer .
제한
- for
- Sum of over every test case does not exceed .
- Sum of over every test case does not exceed .