QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 512 MB Points totaux : 100

#76. Nghệ sĩ dương cầm

Statistiques

Một nghệ sĩ dương cầm muốn chơi đàn piano.

Đàn piano có $10^{100}$ phím, được ghi nhãn $A,B,C,D,E,F,G,A,B,\ldots$ từ trái sang phải. Nghệ sĩ muốn thỏa mãn các điều kiện sau:

  • Anh chọn một phím $A$ và bắt đầu chơi bằng cách nhấn phím đã chọn.
  • Sau khi nhấn phím thứ $i$, ở bước tiếp theo anh có thể nhấn phím thứ $i-1$ hoặc phím thứ $i+1$.
  • Sau khi nhấn một phím $A$, anh cũng có thể ngừng chơi.
  • Phím $A$ đầu tiên và phím $A$ cuối cùng mà anh chơi không nhất thiết phải là cùng một phím.
  • Anh phải nhấn các phím $A$ (không quan trọng là những phím $A$ nào) đúng $C_1$ lần.
  • Tương tự, anh phải nhấn các phím $B,C,D,E,F,G$ lần lượt đúng $C_2,\ldots,C_7$ lần.

Hãy xác định liệu có thể thỏa mãn tất cả các điều kiện trên hay không.

Dữ liệu vào

$C_1\ C_2\ C_3\ C_4\ C_5\ C_6\ C_7$

  • $0\le C_i\le 10^{10}$
  • $\sum C_i>0$

Dữ liệu ra

In YES nếu có thể thỏa mãn tất cả các điều kiện, ngược lại in NO.

Ví dụ

Dữ liệu vào 1

2 1 1 1 1 1 1

Dữ liệu ra 1

YES

Dữ liệu vào 2

1 1 1 1 1 1 1

Dữ liệu ra 2

NO

Dữ liệu vào 3

3 1 0 10000000000 10000000000 0 1

Dữ liệu ra 3

NO

Dữ liệu vào 4

1 0 0 0 0 0 0

Dữ liệu ra 4

YES

Ghi chú

Trong ví dụ 1, anh có thể chơi $A,B,C,D,E,F,G,A$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.