Advertisement
Saleh127

UVA 11850

Jul 19th, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define endl "\n"
  5. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  6. int main()
  7. {
  8. ios_base::sync_with_stdio(0);
  9. cin.tie(0);cout.tie(0);
  10.  
  11. ll n,m,i,j,k,l;
  12.  
  13. while(cin>>n && n)
  14. {
  15.  
  16. ll a[n+5];
  17.  
  18. for(i=0;i<n;i++) cin>>a[i];
  19.  
  20. sort(a,a+n);
  21. l=0;
  22. for(i=1;i<n;i++)
  23. {
  24. if(a[i]-a[i-1]>200)
  25. {
  26. l=1;
  27. break;
  28. }
  29. }
  30.  
  31. if(l) cout<<"IMPOSSIBLE"<<endl;
  32. else
  33. {
  34. if((1422-a[n-1])*2<=200) cout<<"POSSIBLE"<<endl;
  35. else cout<<"IMPOSSIBLE"<<endl;
  36. }
  37. }
  38.  
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement