CF2222A A Wonderful Contest

Description

[Nanatsukaze - Save Our Sound](https://www.youtube.com/watch?v=nLWXur60vC8) As a person who loves competitions, you now need to participate in a wonderful OI contest. This contest has $ n $ problems, each with a full score of $ 100 $ . The $ i $ -th problem has $ a_i $ subtasks, and each subtask has a score of $ \frac{100}{a_i} $ . It is guaranteed that $ a_i $ is a divisor of $ 100 $ . Now, several contestants will participate in this contest. Suppose a contestant solves $ x_i $ ( $ 0\le x_i\le a_i $ ) subtasks of the $ i $ -th problem; his score on the $ i $ -th problem will be $ x_i \cdot \frac{100}{a_i} $ . The total score of the contestant in the contest is the sum of the scores on all problems, i.e., $ \sum\limits_{i=1}^{n} x_i \cdot \frac{100}{a_i} $ . To prove that the contest is a truly wonderful one, you have to check whether it is possible to achieve every integer total score from $ 0 $ to $ 100\cdot n $ (inclusive). Formally, you have to determine whether the following statement holds: - For every integer $ k $ where $ 0\le k\le 100\cdot n $ , there exists an array $ x $ of length $ n $ ( $ 0\le x_i\le a_i $ ) such that $ k=\sum\limits_{i=1}^{n} x_i \cdot \frac{100}{a_i} $ .

Input Format

Each test contains multiple test cases. The first line contains the number of test cases $ t $ ( $ 1 \le t \le 100 $ ). The description of the test cases follows. The first line of each test case contains a single integer $ n $ ( $ 1 \le n \le 10 $ ) — the number of problems in the contest. The second line contains $ n $ integers $ a_1, a_2, \ldots, a_n $ ( $ 1 \le a_i \le 100 $ ) — the number of subtasks of each problem. It is guaranteed that every $ a_i $ is a divisor of $ 100 $ .

Output Format

For each test case, output "Yes" if it is possible to obtain an arbitrary total score between $ 0 $ and $ 100\cdot n $ ; otherwise, output "No". You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

Explanation/Hint

In the first test case, for every integer $ k $ ( $ 0 \leq k \leq 200 $ ), it is possible to achieve a total score of exactly $ k $ . For example, when $ k=10 $ , a contestant who passes $ 0 $ subtasks in the first problem and $ 2 $ subtasks in the second problem achieves a total score of $ 0 \cdot \frac{100}{100} + 2 \cdot \frac{100}{20} = 10 $ . In the second test case, when $ k=95 $ , it can be proven that it is impossible to achieve a total score of exactly $ 95 $ . In the third test case, for every integer $ k $ ( $ 0 \leq k \leq 300 $ ), it is possible to achieve a total score of exactly $ k $ . For example, when $ k=233 $ , a contestant who passes $ 25 $ , $ 83 $ , and $ 25 $ subtasks in the three problems, respectively, achieves a total score of $ 25 \cdot \frac{100}{50} + 83 \cdot \frac{100}{100} + 25 \cdot \frac{100}{25} = 233 $ .