forked from AASF-IIITM/spojprobs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SCPC11B.cpp
57 lines (42 loc) · 819 Bytes
/
SCPC11B.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
50
51
52
53
54
55
56
57
#include<bits/stdc++.h>
using namespace std;
int main()
{
while(1)
{
int t;
cin>>t;
if(t==0)
break;
int arr[t];
for(int i=0; i<t; i++)
cin>>arr[i];
sort(arr,arr+t);
if(arr[0]==0)
{
arr[t]=1422;
int f1=0;
for(int i=1; i<=t; i++)
{
int d1=arr[i]-arr[i-1];
if(d1>200 || (i==t && d1>100) )
{
f1=1;
break;
}
}
if(f1)
{
cout<<"IMPOSSIBLE"<<"\n";
}
else
{
cout<<"POSSIBLE"<<"\n";
}
}
else
{
cout<<"IMPOSSIBLE"<<"\n";
}
}
}