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

3397번 - Division Expression 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB57383175.610%

문제

Division expression is an arithmetic expression of the form

x1/x2/x3/.../xk

where xi is a positive integer, for i,(1 ≤ i ≤ k). Division expression is evaluated from the left to the right. For instance the value of the expression

1/2/1/2

is 1/4. One can put parentheses into expression in order to change its value. For example the value of the expression

(1/2)/(1/2)

is 1. We are given a division expression E. Is it possible to put some parentheses into E to get an expression E' whose value is an integer number.

Task: Write a program that for each data set from a sequence of several data sets:

  • reads an expression E from the input,
  • verifies whether it is possible to put some parentheses in E to get a new expression E' whose value is an integer number,
  • writes the result to the output.

입력

The first line of the input contains one positive integer d,(d ≤ 5). This is the number of data sets. The data sets follow. The first line of each data set contain an integer n,(2 ≤ n ≤ 10000). This is the number of integers in the expression. Each of the following n lines contains exactly one positive integer not greater than 1 000 000 000. The ith number is the ith integer in the expression.

출력

For each i,(1 ≤ i ≤ d) your program should write to the ith line of the output one word YES, if the ith input expression can be transformed into an expression whose value is an integer number, and the word NO in the other case.

제한

예제 입력 1

2
4
1
2
1
2
3
1
2
3

예제 출력 1

YES
NO

힌트

출처

Olympiad > Baltic Olympiad in Informatics > BOI 2000 4번

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

출처

대학교 대회

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

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