CF1028C.Rectangles
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given n rectangles on a plane with coordinates of their bottom left and upper right points. Some (n−1) of the given n rectangles have some common point. A point belongs to a rectangle if this point is strictly inside the rectangle or belongs to its boundary.
Find any point with integer coordinates that belongs to at least (n−1) given rectangles.
输入格式
The first line contains a single integer n ( 2≤n≤132674 ) — the number of given rectangles.
Each the next n lines contains four integers x1 , y1 , x2 and y2 ( −109≤x1<x2≤109 , −109≤y1<y2≤109 ) — the coordinates of the bottom left and upper right corners of a rectangle.
输出格式
Print two integers x and y — the coordinates of any point that belongs to at least (n−1) given rectangles.
输入输出样例
输入#1
3 0 0 1 1 1 1 2 2 3 0 4 1
输出#1
1 1
输入#2
3 0 0 1 1 0 1 1 2 1 0 2 1
输出#2
1 1
输入#3
4 0 0 5 5 0 0 4 4 1 1 4 4 1 1 4 4
输出#3
1 1
输入#4
5 0 0 10 8 1 2 6 7 2 3 5 6 3 4 4 5 8 1 9 2
输出#4
3 4
说明/提示
The picture below shows the rectangles in the first and second samples. The possible answers are highlighted.
The picture below shows the rectangles in the third and fourth samples.