시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 307 95 50 27.322%

문제

길이가 다양한 N개의 막대가 있다. 이때, 막대를 모두 사용해서 정사각형을 만들 수 있을까?

입력

첫째 줄에 테스트 케이스의 개수 T가 주어진다. 각 테스트 케이스는 한 줄로 이루어져 있다. 각 줄의 첫 번째 숫자는 막대의 개수 N이다. (4 ≤ N ≤ 20) 다음 N개의 숫자는 막대의 길이이다. 막대의 길이는 1과 10,000사이의 자연수이다.

출력

각 테스트 케이스 마다 막대를 모두 사용해서 정사각형을 만들 수 있으면 yes를, 아니면 no를 출력한다.

예제 입력 1

3
4 1 1 1 1
5 10 20 30 40 50
8 1 7 2 6 4 4 3 5

예제 출력 1

yes
no
yes
W3sicHJvYmxlbV9pZCI6IjQzNDgiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWI5YzlcdWIzMDAgXHVjODE1XHVjMGFjXHVhYzAxXHVkNjE1IiwiZGVzY3JpcHRpb24iOiI8cD5cdWFlMzhcdWM3NzRcdWFjMDAmbmJzcDtcdWIyZTRcdWM1OTFcdWQ1NWMgTlx1YWMxY1x1Yzc1OCBcdWI5YzlcdWIzMDBcdWFjMDAgXHVjNzg4XHViMmU0LiBcdWM3NzRcdWI1NGMsIFx1YjljOVx1YjMwMFx1Yjk3YyBcdWJhYThcdWI0NTAgXHVjMGFjXHVjNmE5XHVkNTc0XHVjMTFjIFx1YzgxNVx1YzBhY1x1YWMwMVx1ZDYxNVx1Yzc0NCBcdWI5Y2NcdWI0ZTQgXHVjMjE4IFx1Yzc4OFx1Yzc0NFx1YWU0Yz88XC9wPlxyXG4iLCJpbnB1dCI6IjxwPlx1Y2NhYlx1YzlmOCBcdWM5MDRcdWM1ZDAgXHVkMTRjXHVjMmE0XHVkMmI4IFx1Y2YwMFx1Yzc3NFx1YzJhNFx1Yzc1OCBcdWFjMWNcdWMyMTggVFx1YWMwMCBcdWM4ZmNcdWM1YjRcdWM5YzRcdWIyZTQ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ZDZkXHVjNWI0In0seyJwcm9ibGVtX2lkIjoiNDM0OCIsInByb2JsZW1fbGFuZyI6IjEiLCJ0aXRsZSI6IlNxdWFyZSIsImRlc2NyaXB0aW9uIjoiPHA+R2l2ZW4gYSBzZXQgb2Ygc3RpY2tzIG9mIHZhcmlvdXMgbGVuZ3RocywgaXMgaXQgcG9zc2libGUgdG8gam9pbiB0aGVtIGVuZC10by1lbmQgdG8gZm9ybSBhIHNxdWFyZT88XC9wPlxyXG4iLCJpbnB1dCI6IjxwPlRoZSBmaXJzdCBsaW5lIG9mIGlucHV0IGNvbnRhaW5zIE4sIHRoZSBudW1iZXIgb2YgdGVzdCBjYXNlcy4gRWFjaCB0ZXN0IGNhc2UgYmVnaW5zIHdpdGggYW4gaW50ZWdlciA0ICZsdDs9IE0gJmx0Oz0gMjAsIHRoZSBudW1iZXIgb2Ygc3RpY2tzLiBNIGludGVnZXJzIGZvbGxvdzsgZWFjaCBnaXZlcyB0aGUgbGVuZ3RoIG9mIGEgc3RpY2sgLSBhbiBpbnRlZ2VyIGJldHdlZW4gMSBhbmQgMTAsMDAwPFwvcD5cclxuXHJcbjxwPiZuYnNwOzxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPkZvciBlYWNoIGNhc2UsIG91dHB1dCBhIGxpbmUgY29udGFpbmluZyAmcXVvdDt5ZXMmcXVvdDsgaWYgaXMgaXMgcG9zc2libGUgdG8gZm9ybSBhIHNxdWFyZTsgb3RoZXJ3aXNlIG91dHB1dCAmcXVvdDtubyZxdW90OzxcL3A+XHJcblxyXG48cD4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

Contest > Waterloo's local Programming Contests > 21 September, 2002 C번

  • 문제를 번역한 사람: baekjoon
  • 문제의 오타를 찾은 사람: isku