logo AlgoBeat OnlineJudge
登录 注册

#216156. [ICPC 2023 NAC] Four Square

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

题目描述

Inspired by a Piet Mondrian painting, you want to make a four-pane window out of four colored rectangles of glass. You are given the sizes of the four panes of glass. Can you arrange them into a square? You may rotate the panes. The panes should cover the entire square without overlap.

输入格式

The input consists of exactly four lines. Each of the four lines contains two integers and (), representing the width and height of one of the four rectangular panes of glass.

输出格式

Output a single integer, which is if the four panes can be arranged to form a square, and otherwise.

样例

样例输入 1

1 1
1 1
1 1
1 1

样例输出 1

1

样例输入 2

3 1
3 3
2 2
3 3

样例输出 2

0