logo AlgoBeat OnlineJudge
登录 注册

#213720. [NWRRC 2022] Absolutely Flat

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

题目描述

Alice is a proud owner of a four-legged table, and she wants her table to be flat. Alice considers the table to be flat if its four legs have equal lengths.

Alice measured the table's current leg lengths and got , and . She also has a pad of length . Alice can attach the pad to one of the legs, in which case the length of that leg will increase by . She can also decide not to attach the pad, in which case the lengths of the legs will not change. Note that Alice has just a single pad, so she can neither apply it twice to the same leg nor apply it to two different legs.

Find out whether Alice can make her table flat.

输入格式

The input contains five positive integers , and , each on a separate line --- the lengths of the table's legs, and the length of the pad Alice has ().

输出格式

Print if Alice can make her table flat, and otherwise.

样例

样例输入 1

10
10
10
10
5

样例输出 1

1

样例输入 2

13
13
5
13
8

样例输出 2

1

样例输入 3

50
42
42
50
8

样例输出 3

0

样例输入 4

20
40
10
30
2

样例输出 4

0

数据范围与提示

In the first example test, the table is already flat, no pad is needed.

In the second example test, Alice can apply the pad to the third leg to make the table flat.

In the third and the fourth example tests, Alice can not make her table flat.