시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB141262222.222%

문제

N(1 ≤ N ≤ 20)개의 반원 모양의 철사들이 있다. 이들 중 몇 개를 택해서 붙였을 때, 하나의 연결된 모양(폐곡선)을 만들 수 있는지 알아내는 프로그램을 작성하시오. 두 개의 반원 모양의 철사는 그 끝을 임의의 각도로 붙일 수 있지만(즉, 각각의 반원을 얼마든지 회전할 수 있다), 중간에 다른 철사와 겹치는 부분이 있어서는 안 된다.

입력

첫째 줄에 데이터의 개수 K(1 ≤ K ≤ 30)가 주어진다. 각 데이터의 첫째 줄에는 N이 주어지고, 그 다음 줄에는 각 반원의 반지름을 나타내는 실수가 N개 주어진다. 각 실수는 10,000,000 이하의 양의 실수이고, 소숫점 아래 셋째 자리까지 입력될 수 있다.

출력

각 데이터에 대해서 가능한 경우에는 YES, 불가능한 경우에는 NO를 출력한다.

예제 입력 1

4
1
4.000
2
1.000 1.000
3
1.455 2.958 4.424
7
1.230 2.577 3.411 2.968 5.301 4.398 6.777

예제 출력 1

NO
YES
NO
YES
W3sicHJvYmxlbV9pZCI6IjIwNjMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWNjYTBcdWMwYWMgXHVjNWYwXHVhY2IwIiwiZGVzY3JpcHRpb24iOiI8cCBzdHlsZT1cInRleHQtYWxpZ246IGNlbnRlcjtcIj48aW1nIGFsdD1cIlwiIGhlaWdodD1cIjI0MVwiIHNyYz1cIlwvSnVkZ2VPbmxpbmVcL3VwbG9hZFwvMjAxMDA3XC93aXJlLnBuZ1wiIHdpZHRoPVwiMzI0XCIgXC8+PFwvcD5cclxuXHJcbjxwPk4oMSAmbGU7IE4gJmxlOyAyMClcdWFjMWNcdWM3NTggXHViYzE4XHVjNmQwIFx1YmFhOFx1YzU5MVx1Yzc1OCBcdWNjYTBcdWMwYWNcdWI0ZTRcdWM3NzQgXHVjNzg4XHViMmU0LiBcdWM3NzRcdWI0ZTQgXHVjOTExIFx1YmE4NyBcdW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