F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Goffi and Median

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1271    Accepted Submission(s): 647


Problem Description
A median in a sequence with the length of \(n\) is an element which occupies position number \(\Large\lfloor \frac{n + 1}{2} \rfloor\) after we sort the elements in the non-decreasing order (the elements are numbered starting with 1). A median of an array (2, 6, 1, 2, 3) is the number 2, and a median of array (0, 96, 17, 23) ¡ª the number 17.

An average of a sequence is the sum of sequence divided the size of the sequence.

Goffi likes median very much and he hates average number. So if a sequence's average number is larger than or equal to the median of sequence, Goffi will hate the sequence. Otherwise, Goffi will like it.

Now, your are given a sequence. Please find whether Goffi will like it or hate it.
 

Input
Input contains multiple test cases (less than 100). For each test case, the first line contains an integer \(n\) (\(1 \le n \le 1000\)), indicating the size of the sequence. Then in the next line, there are \(n\) integers \(a_1, a_2, \dots, a_n\) (\(1 \le a_i \le 1000\)), seperated by one space.
 

Output
For each case, if Goffi like the sequence, output "YES" in a line. Otherwise, output "NO".
 

Sample Input
5 1 2 3 4 5 4 1 5 6 6
 

Sample Output
NO YES
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-03 19:39:13, Gzip enabled