Logo
(追記) (追記ここまで)

26863번 - Absolutely Flat 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB48032028367.703%

문제

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 $a_1, a_2, a_3,ドル and $a_4$. She also has a pad of length $b$. Alice can attach the pad to one of the legs, in which case the length of that leg will increase by $b$. 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 $a_1, a_2, a_3, a_4,ドル and $b,ドル each on a separate line --- the lengths of the table's legs, and the length of the pad Alice has (1ドル \le a_i, b \le 100$).

출력

Print 1ドル$ if Alice can make her table flat, and 0ドル$ 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.

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2022-2023 North-Western Russia Regional Contest A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /