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

14194번 - Grades 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB30015814052.632%

문제

Professor Snape has just marked the final exam papers and wants to know if the distribution of grades is satisfactory or not. He first sorted all papers by their grades and then took the best and worst marks and took their average. Let’s call his number A. Then he took the average of all the grades. Let this number be called B. If and only if the absolute difference between A and B is less than 1, he considers the distribution to be satisfactory.

Write a program to help professor Snape.

입력

The first line contains the number of test cases T.

Each test case consists of two lines, the first line is a single integer, n ≤ 50000, the number of students and the second line has n space separated non-negative integers smaller than 101, the grades students received.

출력

For each test case print “Yes” (without quotations) if the distribution is satisfactory and “No” (without quotations) otherwise.

제한

예제 입력 1

2
3
1 2 3
3
1 10 100

예제 출력 1

Yes
No

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > Iran Internet Programming Contest > IIPC 2016 A번

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

출처

대학교 대회

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

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