Description

有一天,雷曼想要買一條 $23$ 元的麵包,付了一張 $100$ 元鈔票,收銀員找回一張 $50$ 元、兩個 $10$ 元、一個 $5$ 元和兩個 $1$ 元。「這樣實在是太沒效率了!」雷曼心想,他把這個想法告訴了好友格羅伯,格羅伯便設計了一套新的金錢系統,從 $1$ 元到 $1000$ 元的硬幣都有,每一枚都獨一無二

現在,你要幫他們測試這套系統好不好用。假設你身上有 $n$ 個硬幣,面額分別是 $a_1 \sim a_n$,是否有辦法在不找錢的情況下買一個 $k$ 元的商品?

Input Format

第一行為一個整數 $n$
第二行為多個整數 $a_1 \sim a_n$
第三行為一個整數 $k$

條件:

$0 < n < 1000$
$0 < a_i < 1000\ \forall i \in \mathbb N$
$0 < k < 10^6$

Output Format

如果可以湊出指定金額,輸出 Yahoo!,否則輸出 Wah...

Sample Input 1

3
1 2 7
8

Sample Output 1

Yahoo!

Sample Input 2

4
5 6 7 8
16

Sample Output 2

Wah...

Hints

Problem Source

TopCoder


$\texttt{<script>alert(":3");</script>}$

User's AC Ratio

100.0% (1/1)

Tags

Problem Setter

Created by

Subtasks

No. Testdata Range Constraints Score
1 0~1 範例測資 10
2 2~5 $k < \sum\limits_{i=1}^{n} a_i$ 30
3 6~9 60

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 65536 1
1 1000 65536 65536 1
2 2000 65536 65536 2
3 2000 65536 65536 2
4 2000 65536 65536 2
5 2000 65536 65536 2
6 2000 65536 65536 3
7 2000 65536 65536 3
8 2000 65536 65536 3
9 2000 65536 65536 3