CF1108A.Two distinct points
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given two segments [l1;r1] and [l2;r2] on the x -axis. It is guaranteed that l1<r1 and l2<r2 . Segments may intersect, overlap or even coincide with each other.
The example of two segments on the x -axis.Your problem is to find two integers a and b such that l1≤a≤r1 , l2≤b≤r2 and a=b . In other words, you have to choose two distinct integer points in such a way that the first point belongs to the segment [l1;r1] and the second one belongs to the segment [l2;r2] .
It is guaranteed that the answer exists. If there are multiple answers, you can print any of them.
You have to answer q independent queries.
输入格式
The first line of the input contains one integer q ( 1≤q≤500 ) — the number of queries.
Each of the next q lines contains four integers l1i,r1i,l2i and r2i ( 1≤l1i,r1i,l2i,r2i≤109,l1i<r1i,l2i<r2i ) — the ends of the segments in the i -th query.
输出格式
Print 2q integers. For the i -th query print two integers ai and bi — such numbers that l1i≤ai≤r1i , l2i≤bi≤r2i and ai=bi . Queries are numbered in order of the input.
It is guaranteed that the answer exists. If there are multiple answers, you can print any.
输入输出样例
输入#1
5 1 2 1 2 2 6 3 4 2 4 1 3 1 2 1 3 1 4 5 8
输出#1
2 1 3 4 3 2 1 2 3 7