logo AlgoBeat OnlineJudge
登录 注册

#216184. [ICPC 2019 NAIPC] Intersecting Rectangles

内存限制:1024 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

You are given a set of axis-aligned rectangles in a 2D plane. For this problem, two rectangles are considered to intersect if their boundaries contain any common points (in particular, two nesting rectangles don’t count as intersecting). Determine if some pair of rectangles intersect.

:::align{center} :::

In this example, only rectangles A and B intersect.

输入格式

Each test case will begin with a line with a single integer (), which is the number of rectangles.

Each of the next lines will contain four space-separated integers:

(, , ), which describe a rectangle, where is the lower left corner and is the upper right corner. All values will be distinct. All values will be distinct.

输出格式

Output a single integer, which is if some pair of rectangles intersect, if no pair of rectangles intersect.

样例

样例输入 1

3
0 0 2 2
1 1 3 4
5 7 6 8

样例输出 1

1

样例输入 2

4
0 0 20 20
1 1 3 4
2 10 9 12
11 3 19 18

样例输出 2

0