-
Notifications
You must be signed in to change notification settings - Fork 13
/
PHONELST.cpp
49 lines (40 loc) · 901 Bytes
/
PHONELST.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
#define pb push_back
#define pi 3.141592653589793238462643383
int main()
{
int t;
scanf("%d",&t);
while(t--){
int n;
scanf("%d",&n);
if(n==0)
break;
vector<int> a;
long long i,j;
for(i=0;i<n;i++){
scanf("%lld",&j);
a.pb(j);
}
sort(a.begin(),a.end());
int flag=0;
for(i=1;i<n;i++){
if(a[i]-a[i-1]>200){
flag=1;
break;
}
}
if(2*(1422-a[n-1])>200||a[0]>200)
flag=1;
if(flag==0)
printf("YES\n");
else
printf("NO\n");
}
system ("pause");
return 0;
}