Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<algorithm>
- using namespace std;
- int main() {
- int n;
- while (cin >> n) {
- if (n == 0) {
- break;
- }
- else {
- int A[n];
- for (int i = 0; i < n; i++) {
- cin >> A[i];
- }
- sort(A,A+n);
- int c = 0;
- if (A[n-1] < 1322) {
- c++;
- }
- else {
- for (int j = 0; j < n-1; j++) {
- if ((A[j+1]-A[j]) > 200) {
- c++;
- break;
- }
- }
- }
- if (c == 0) {
- cout << "POSSIBLE" << endl;
- }
- else {
- cout << "IMPOSSIBLE" << endl;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement