Advertisement
noshin98

uva 11850

Jan 3rd, 2017
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.97 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <cstring>
  5. #include <string>
  6. #include <cctype>
  7. #include <stack>
  8. #include <queue>
  9. #include <list>
  10. #include <vector>
  11. #include <map>
  12. #include <sstream>
  13. #include <cmath>
  14. #include <bitset>
  15. #include <utility>
  16. #include <set>
  17. #include <numeric>
  18. #define INT_MAX 2147483647
  19. #define INT_MIN -2147483647
  20. #define pi acos(-1.0)
  21. #define N 1000000
  22. #define LL unsigned long long
  23. using namespace std;
  24.  
  25.  
  26. int main ()
  27. {
  28.     int n;
  29.  
  30.     while ( scanf ("%d", &n) && n ) {
  31.         int a [1422 + 10];
  32.  
  33.         for ( int i = 0; i < n; i++ ) scanf ("%d", &a [i]);
  34.  
  35.         sort (a, a + n);
  36.  
  37.         bool possible = true;
  38.  
  39.         for ( int i = 1; i < n; i++ )
  40.             if ( a [i] - a [i - 1] > 200 ) possible = false;
  41.  
  42.         if ( 2 * (1422 - a [n - 1]) > 200 ) possible = false;
  43.  
  44.         if ( possible ) printf ("POSSIBLE\n");
  45.         else printf ("IMPOSSIBLE\n");
  46.     }
  47.  
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement