QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#109424#5199. Amazing Trickgigabuffoon#AC ✓52ms5796kbC++202.2kb2023-05-28 23:40:322023-05-28 23:40:34

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-28 23:40:34]
  • 评测
  • 测评结果:AC
  • 用时:52ms
  • 内存:5796kb
  • [2023-05-28 23:40:32]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define all(a) begin(a), end(a)
#define sz(a) int(size(a))
#define rep(i,a,b) for(int i=a;i<(b);++i)
using vi = vector<int>;

const int MAXB = 7;
vector<vi> dranges[MAXB+1];

void gen(vi &a, vi &used, int idx, int n) {
    if(idx == n) {
        dranges[n].push_back(a);
        return;
    }
    for(int i = 0; i < n; i++) if(i != idx and !used[i]) {
        used[i] = true;
        a[idx] = i;
        gen(a, used, idx+1, n);
        a[idx] = -1;
        used[i] = false;
    }
}

void precomp() {
    srand(time(0));
    for(int n = 1; n <= MAXB; n++) {
        vi a(n, -1), used(n);
        gen(a, used, 0, n);
    }
}

void solve(int tc) {
    int N; cin >> N;
    vi A(N), pos(N);
    for(int i = 0; i < N; i++)
        cin >> A[i], --A[i], pos[A[i]] = i;

    vi finP, pPos(N), Q(N);

    if(N <= MAXB) {
        for(vi &P : dranges[N]) {
            rep(i,0,N) pPos[P[i]] = i;
            bool bad = false;
            rep(i,0,N) if((Q[i] = pPos[pos[i]]) == i) { bad = true; break; }
            if(bad) continue;
            finP = P;
            break;
        }
    } else {
        vi P(N); iota(all(P), 0);
        while(true) {
            random_shuffle(all(P));
            bool bad = false;
            rep(i,0,N) {
                if(P[i] == i) bad = true;
                pPos[P[i]] = i;
            }
            if(bad) continue;
            rep(i,0,N) if((Q[i] = pPos[pos[i]]) == i) { bad = true; break; }
            if(bad) continue;
            break;
        }
        finP = P;
    }

    if(sz(finP)) {
        // we got 'em
        cout << "Possible" << '\n';
        vi P = finP;
        for(int x : P) cout << ++x << ' ';
        cout << '\n';
        for(int x : Q) cout << ++x << ' ';
        cout << '\n';
        rep(i,0,N) if(i != A[P[Q[i]]] or P[i] == i or Q[i] == i) {
            assert(false);
        }
        return;
    } else
        cout << "Impossible" << '\n';
}

int main() {
    cin.tie(0)->sync_with_stdio(false);
    cin.exceptions(cin.failbit);
    precomp();
    int t = 1;
    cin >> t;
    for(int i = 1; i <= t; i++) solve(i);
    cout.flush(); return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3628kb

input:

4
2
2 1
3
1 2 3
4
2 1 4 3
5
5 1 4 2 3

output:

Impossible
Possible
2 3 1 
3 1 2 
Possible
3 4 1 2 
4 3 2 1 
Possible
3 1 2 5 4 
3 5 4 1 2 

result:

ok 3/4 are 'Possible' (4 test cases)

Test #2:

score: 0
Accepted
time: 2ms
memory: 3676kb

input:

50
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Imp...

result:

ok 0/50 are 'Possible' (50 test cases)

Test #3:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

25
2
2 1
2
2 1
2
2 1
2
1 2
2
2 1
2
1 2
2
1 2
2
1 2
2
1 2
2
1 2
2
2 1
2
2 1
2
1 2
2
1 2
2
2 1
2
2 1
2
2 1
2
1 2
2
1 2
2
1 2
2
2 1
2
2 1
2
2 1
2
2 1
2
2 1

output:

Impossible
Impossible
Impossible
Possible
2 1 
2 1 
Impossible
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Impossible
Impossible
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Impossible
Impossible
Impossible
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Possible
2 ...

result:

ok 11/25 are 'Possible' (25 test cases)

Test #4:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

16
3
3 2 1
3
3 1 2
3
3 1 2
3
2 3 1
3
3 1 2
3
2 1 3
3
2 3 1
3
3 2 1
3
3 1 2
3
2 1 3
3
1 2 3
3
1 3 2
3
3 1 2
3
3 1 2
3
3 2 1
3
2 1 3

output:

Impossible
Possible
3 1 2 
3 1 2 
Possible
3 1 2 
3 1 2 
Possible
2 3 1 
2 3 1 
Possible
3 1 2 
3 1 2 
Impossible
Possible
2 3 1 
2 3 1 
Impossible
Possible
3 1 2 
3 1 2 
Impossible
Possible
2 3 1 
3 1 2 
Impossible
Possible
3 1 2 
3 1 2 
Possible
3 1 2 
3 1 2 
Impossible
Impossible

result:

ok 9/16 are 'Possible' (16 test cases)

Test #5:

score: 0
Accepted
time: 2ms
memory: 3740kb

input:

12
4
2 4 1 3
4
2 4 1 3
4
1 3 2 4
4
2 4 1 3
4
4 1 2 3
4
2 4 3 1
4
1 3 4 2
4
3 4 2 1
4
2 4 3 1
4
1 3 2 4
4
3 4 1 2
4
1 3 4 2

output:

Possible
2 4 1 3 
4 3 2 1 
Possible
2 4 1 3 
4 3 2 1 
Possible
2 1 4 3 
2 4 1 3 
Possible
2 4 1 3 
4 3 2 1 
Possible
3 4 1 2 
4 1 2 3 
Possible
2 3 4 1 
3 4 2 1 
Possible
2 3 4 1 
4 3 1 2 
Possible
2 1 4 3 
3 4 2 1 
Possible
2 3 4 1 
3 4 2 1 
Possible
2 1 4 3 
2 4 1 3 
Possible
2 1 4 3 
4 3 2 1 
Pos...

result:

ok 12/12 are 'Possible' (12 test cases)

Test #6:

score: 0
Accepted
time: 2ms
memory: 3664kb

input:

10
5
5 4 3 2 1
5
1 5 3 2 4
5
3 1 5 2 4
5
1 5 4 3 2
5
1 3 2 5 4
5
1 2 3 5 4
5
3 1 4 2 5
5
3 4 1 2 5
5
5 1 3 4 2
5
5 3 2 1 4

output:

Possible
2 1 4 5 3 
4 3 5 1 2 
Possible
2 1 5 3 4 
2 5 4 3 1 
Possible
3 1 5 2 4 
4 5 2 3 1 
Possible
2 3 1 5 4 
3 4 5 2 1 
Possible
2 4 5 1 3 
4 5 1 3 2 
Possible
2 4 5 1 3 
4 1 5 3 2 
Possible
3 1 2 5 4 
3 5 2 1 4 
Possible
2 1 4 5 3 
5 3 2 1 4 
Possible
3 1 2 5 4 
3 4 1 5 2 
Possible
2 1 5 3 4 
5...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #7:

score: 0
Accepted
time: 1ms
memory: 3672kb

input:

8
6
5 4 3 6 2 1
6
2 1 3 4 5 6
6
1 6 4 5 2 3
6
1 2 3 4 5 6
6
3 6 1 2 5 4
6
2 6 3 5 4 1
6
1 2 4 5 3 6
6
5 3 4 2 6 1

output:

Possible
2 1 4 3 6 5 
5 6 4 1 2 3 
Possible
3 4 1 2 6 5 
4 3 1 2 6 5 
Possible
2 1 4 5 6 3 
2 4 5 6 3 1 
Possible
2 1 4 3 6 5 
2 1 4 3 6 5 
Possible
2 1 4 3 6 5 
4 3 2 5 6 1 
Possible
2 3 4 1 6 5 
5 4 2 6 3 1 
Possible
2 1 4 5 6 3 
2 1 4 6 3 5 
Possible
2 1 4 5 6 3 
5 3 1 6 2 4 

result:

ok 8/8 are 'Possible' (8 test cases)

Test #8:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

7
7
3 7 6 5 2 1 4
7
6 1 3 2 7 4 5
7
2 4 1 6 7 5 3
7
4 3 5 1 2 6 7
7
3 1 5 7 2 4 6
7
2 3 4 6 7 5 1
7
7 4 2 6 3 1 5

output:

Possible
2 1 4 3 6 7 5 
5 7 2 6 3 4 1 
Possible
3 1 2 5 4 7 6 
3 5 1 7 6 2 4 
Possible
2 3 1 5 4 7 6 
2 3 6 1 7 5 4 
Possible
2 1 4 3 6 7 5 
3 7 1 2 4 5 6 
Possible
3 1 2 5 7 4 6 
3 4 2 7 1 5 6 
Possible
2 3 1 5 4 7 6 
6 3 1 2 7 5 4 
Possible
2 1 4 3 6 7 5 
5 4 7 1 6 3 2 

result:

ok 7/7 are 'Possible' (7 test cases)

Test #9:

score: 0
Accepted
time: 2ms
memory: 3724kb

input:

6
8
6 1 5 3 7 8 4 2
8
4 5 8 1 3 6 2 7
8
6 5 8 2 4 1 3 7
8
4 2 5 3 7 1 8 6
8
5 7 2 6 3 8 4 1
8
4 1 5 3 7 2 8 6

output:

Possible
4 3 6 8 7 5 1 2 
8 4 1 5 2 7 6 3 
Possible
8 1 4 3 6 5 2 7 
3 8 6 2 7 5 1 4 
Possible
3 7 6 1 8 5 4 2 
3 7 2 6 8 4 5 1 
Possible
8 5 2 6 7 4 1 3 
4 3 6 7 8 1 2 5 
Possible
5 8 4 6 7 2 3 1 
2 7 1 5 8 3 6 4 
Possible
4 3 5 7 6 1 8 2 
8 5 1 6 2 7 3 4 

result:

ok 6/6 are 'Possible' (6 test cases)

Test #10:

score: 0
Accepted
time: 2ms
memory: 3708kb

input:

5
9
2 8 5 3 4 6 9 7 1
9
5 8 2 6 4 7 1 9 3
9
4 5 1 6 9 8 7 3 2
9
9 5 7 6 4 2 8 3 1
9
7 3 2 5 8 9 6 4 1

output:

Possible
8 7 1 2 9 3 4 5 6 
5 3 7 8 6 9 1 4 2 
Possible
9 6 2 8 4 5 3 7 1 
8 7 1 6 9 5 2 3 4 
Possible
2 6 5 3 8 9 1 4 7 
4 6 5 7 1 8 9 2 3 
Possible
2 5 6 7 4 1 8 9 3 
8 3 7 2 1 5 9 4 6 
Possible
3 4 1 5 6 8 9 2 7 
7 1 8 6 2 9 3 4 5 

result:

ok 5/5 are 'Possible' (5 test cases)

Test #11:

score: 0
Accepted
time: 2ms
memory: 3740kb

input:

5
10
10 5 3 8 9 6 1 7 4 2
10
10 9 4 8 6 1 7 3 5 2
10
4 10 7 3 6 9 5 1 8 2
10
6 1 8 10 7 5 3 4 2 9
10
8 10 9 1 2 4 7 6 3 5

output:

Possible
6 9 8 10 4 2 5 7 1 3 
8 4 10 2 6 1 3 5 7 9 
Possible
4 3 10 5 8 1 6 9 7 2 
7 3 5 2 8 4 9 1 10 6 
Possible
7 6 8 10 3 9 2 5 4 1 
3 4 9 10 1 8 5 6 2 7 
Possible
7 6 5 10 4 8 2 9 3 1 
7 8 1 6 2 10 3 9 4 5 
Possible
10 7 8 1 2 4 9 5 6 3 
6 8 7 9 1 3 2 4 10 5 

result:

ok 5/5 are 'Possible' (5 test cases)

Test #12:

score: 0
Accepted
time: 18ms
memory: 3680kb

input:

100000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Impossible
Imp...

result:

ok 0/100000 are 'Possible' (100000 test cases)

Test #13:

score: 0
Accepted
time: 19ms
memory: 3664kb

input:

50000
2
1 2
2
1 2
2
1 2
2
1 2
2
2 1
2
1 2
2
2 1
2
2 1
2
1 2
2
1 2
2
1 2
2
2 1
2
2 1
2
1 2
2
2 1
2
2 1
2
1 2
2
2 1
2
2 1
2
1 2
2
2 1
2
2 1
2
1 2
2
2 1
2
1 2
2
2 1
2
2 1
2
1 2
2
2 1
2
1 2
2
2 1
2
2 1
2
2 1
2
2 1
2
2 1
2
2 1
2
2 1
2
2 1
2
2 1
2
1 2
2
1 2
2
2 1
2
2 1
2
1 2
2
2 1
2
1 2
2
2 1
2
2 1
2
2 1
...

output:

Possible
2 1 
2 1 
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Impossible
Possible
2 1 
2 1 
Impossible
Impossible
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Possible
2 1 
2 1 
Impossible
Impossible
Possible
2 1 
2 1 
Impossible
Impossible
Possible
2 1 
2 1 
Impossible
Impossible
Possible
2 ...

result:

ok 25064/50000 are 'Possible' (50000 test cases)

Test #14:

score: 0
Accepted
time: 21ms
memory: 3676kb

input:

33333
3
3 2 1
3
2 3 1
3
2 3 1
3
3 1 2
3
2 1 3
3
2 3 1
3
2 3 1
3
2 3 1
3
2 1 3
3
1 2 3
3
2 1 3
3
2 3 1
3
3 1 2
3
1 3 2
3
2 1 3
3
1 2 3
3
1 3 2
3
2 1 3
3
1 2 3
3
2 3 1
3
1 3 2
3
2 3 1
3
3 2 1
3
1 3 2
3
3 1 2
3
3 1 2
3
2 1 3
3
3 1 2
3
3 1 2
3
3 1 2
3
1 3 2
3
3 2 1
3
3 2 1
3
3 2 1
3
3 1 2
3
2 3 1
3
1 3 ...

output:

Impossible
Possible
2 3 1 
2 3 1 
Possible
2 3 1 
2 3 1 
Possible
3 1 2 
3 1 2 
Impossible
Possible
2 3 1 
2 3 1 
Possible
2 3 1 
2 3 1 
Possible
2 3 1 
2 3 1 
Impossible
Possible
2 3 1 
3 1 2 
Impossible
Possible
2 3 1 
2 3 1 
Possible
3 1 2 
3 1 2 
Impossible
Impossible
Possible
2 3 1 
3 1 2 
Impo...

result:

ok 16621/33333 are 'Possible' (33333 test cases)

Test #15:

score: 0
Accepted
time: 23ms
memory: 3716kb

input:

25000
4
1 4 2 3
4
1 2 4 3
4
4 3 1 2
4
2 3 4 1
4
2 3 1 4
4
4 1 2 3
4
4 3 2 1
4
4 1 2 3
4
4 2 3 1
4
3 4 1 2
4
3 2 1 4
4
1 2 3 4
4
1 2 4 3
4
4 1 3 2
4
3 2 1 4
4
4 2 1 3
4
2 4 3 1
4
3 1 4 2
4
4 2 1 3
4
1 2 4 3
4
4 1 2 3
4
3 4 1 2
4
1 3 2 4
4
2 1 3 4
4
1 3 4 2
4
1 2 4 3
4
4 1 3 2
4
2 4 3 1
4
1 3 2 4
4
4 ...

output:

Possible
2 4 1 3 
3 4 2 1 
Possible
3 4 1 2 
3 4 2 1 
Possible
2 1 4 3 
4 3 1 2 
Possible
2 3 4 1 
3 4 1 2 
Possible
2 3 4 1 
2 4 1 3 
Possible
3 4 1 2 
4 1 2 3 
Possible
2 1 4 3 
3 4 1 2 
Possible
3 4 1 2 
4 1 2 3 
Possible
2 1 4 3 
3 1 4 2 
Possible
2 1 4 3 
4 3 2 1 
Possible
2 1 4 3 
4 1 2 3 
Pos...

result:

ok 25000/25000 are 'Possible' (25000 test cases)

Test #16:

score: 0
Accepted
time: 25ms
memory: 3632kb

input:

20000
5
2 3 5 4 1
5
2 3 5 1 4
5
4 5 1 3 2
5
5 3 2 1 4
5
5 4 3 1 2
5
2 5 4 3 1
5
2 5 3 1 4
5
1 3 5 4 2
5
1 5 4 3 2
5
4 1 3 5 2
5
3 4 5 1 2
5
2 5 1 4 3
5
5 4 3 1 2
5
3 2 5 4 1
5
5 3 2 4 1
5
3 2 1 4 5
5
3 5 1 2 4
5
2 3 5 1 4
5
5 4 2 3 1
5
4 5 2 1 3
5
4 5 2 1 3
5
3 1 5 4 2
5
4 3 5 2 1
5
2 4 5 3 1
5
2 3 ...

output:

Possible
2 3 1 5 4 
4 3 1 5 2 
Possible
2 3 5 1 4 
5 4 1 3 2 
Possible
2 1 5 3 4 
4 3 5 2 1 
Possible
2 1 5 3 4 
5 4 1 3 2 
Possible
2 1 4 5 3 
3 4 5 1 2 
Possible
2 3 1 5 4 
4 3 5 2 1 
Possible
2 3 5 1 4 
5 4 2 3 1 
Possible
2 1 5 3 4 
2 3 1 5 4 
Possible
2 3 1 5 4 
3 4 5 2 1 
Possible
3 1 4 5 2 
5...

result:

ok 20000/20000 are 'Possible' (20000 test cases)

Test #17:

score: 0
Accepted
time: 26ms
memory: 3632kb

input:

16666
6
5 4 6 1 2 3
6
5 3 2 1 4 6
6
1 5 3 4 2 6
6
4 5 1 2 3 6
6
2 6 1 4 3 5
6
4 1 3 2 5 6
6
3 1 6 2 5 4
6
3 5 4 2 1 6
6
4 3 1 6 5 2
6
5 3 2 4 6 1
6
1 6 2 3 5 4
6
3 1 5 6 4 2
6
5 4 2 1 3 6
6
2 6 5 1 4 3
6
5 6 3 4 2 1
6
2 3 1 4 5 6
6
1 3 4 2 6 5
6
4 6 3 5 2 1
6
1 6 2 4 5 3
6
4 5 2 3 1 6
6
5 3 6 4 1 2
...

output:

Possible
2 1 4 3 6 5 
3 6 5 1 2 4 
Possible
2 1 4 3 6 5 
3 4 1 6 2 5 
Possible
2 1 4 3 6 5 
2 6 4 3 1 5 
Possible
2 1 4 3 6 5 
4 3 6 2 1 5 
Possible
2 3 1 6 4 5 
2 3 6 5 4 1 
Possible
3 1 2 5 6 4 
3 6 1 2 4 5 
Possible
3 1 2 5 6 4 
3 6 2 5 4 1 
Possible
2 1 4 5 6 3 
4 3 2 6 1 5 
Possible
2 1 4 3 6 5...

result:

ok 16666/16666 are 'Possible' (16666 test cases)

Test #18:

score: 0
Accepted
time: 26ms
memory: 3732kb

input:

14285
7
3 1 2 4 7 5 6
7
5 2 1 3 4 7 6
7
2 1 6 4 7 3 5
7
5 3 7 2 4 1 6
7
2 4 3 5 7 1 6
7
2 4 7 3 6 1 5
7
2 3 5 1 4 6 7
7
7 2 6 5 1 3 4
7
5 7 6 2 1 4 3
7
1 3 4 6 2 7 5
7
7 6 3 5 4 2 1
7
7 4 2 6 3 5 1
7
7 5 4 2 3 6 1
7
6 1 7 5 3 2 4
7
1 6 3 5 4 7 2
7
6 7 1 3 5 2 4
7
5 7 4 6 2 1 3
7
4 7 3 6 2 5 1
7
5 6 ...

output:

Possible
3 1 2 5 7 4 6 
3 1 2 6 7 5 4 
Possible
2 1 5 6 7 3 4 
6 1 7 3 2 5 4 
Possible
3 4 1 5 2 7 6 
5 3 7 2 6 1 4 
Possible
2 1 4 3 7 5 6 
7 3 1 6 2 5 4 
Possible
2 3 1 5 7 4 6 
7 3 2 1 6 5 4 
Possible
2 3 1 5 4 7 6 
7 3 5 1 6 4 2 
Possible
2 3 1 6 4 7 5 
5 3 1 7 2 4 6 
Possible
2 1 4 3 6 7 5 
7 1...

result:

ok 14285/14285 are 'Possible' (14285 test cases)

Test #19:

score: 0
Accepted
time: 36ms
memory: 3676kb

input:

12500
8
7 4 6 3 1 5 2 8
8
8 1 6 7 2 5 4 3
8
8 5 2 4 6 7 1 3
8
3 2 1 8 4 6 7 5
8
7 2 4 5 3 6 1 8
8
3 5 7 8 2 4 1 6
8
2 4 7 6 1 8 5 3
8
8 4 1 3 5 6 7 2
8
6 2 7 8 1 4 5 3
8
5 8 1 2 4 3 6 7
8
8 5 6 7 1 2 4 3
8
7 1 5 8 4 6 3 2
8
8 1 2 4 6 7 5 3
8
5 3 2 1 6 4 7 8
8
1 8 5 3 4 7 2 6
8
7 1 8 4 6 3 2 5
8
8 7 ...

output:

Possible
4 1 6 7 8 5 3 2 
6 4 1 8 3 7 2 5 
Possible
4 6 7 3 8 1 2 5 
7 8 5 3 2 4 1 6 
Possible
2 8 1 3 6 4 5 7 
8 4 2 6 1 7 5 3 
Possible
2 7 8 1 4 5 3 6 
7 1 4 6 3 8 2 5 
Possible
3 6 1 2 8 7 4 5 
6 4 8 1 7 2 3 5 
Possible
6 3 5 8 1 7 4 2 
6 3 5 1 8 4 2 7 
Possible
8 6 4 3 1 2 5 7 
7 5 1 6 8 3 4 2 ...

result:

ok 12500/12500 are 'Possible' (12500 test cases)

Test #20:

score: 0
Accepted
time: 36ms
memory: 3680kb

input:

11111
9
8 9 5 7 6 1 4 2 3
9
2 1 7 8 3 6 4 9 5
9
7 5 9 8 4 1 3 2 6
9
4 3 9 2 1 6 7 8 5
9
4 1 8 7 9 2 3 5 6
9
1 9 8 6 2 7 4 5 3
9
3 6 1 9 2 7 5 4 8
9
9 1 3 4 7 2 6 5 8
9
2 7 1 5 3 4 6 9 8
9
6 2 1 7 9 5 4 3 8
9
6 1 3 4 7 9 8 5 2
9
3 7 5 8 6 4 1 2 9
9
2 5 3 9 4 1 8 7 6
9
6 5 1 8 3 2 9 7 4
9
1 7 5 9 2 6 ...

output:

Possible
7 6 5 3 1 2 8 9 4 
2 7 8 1 4 3 9 5 6 
Possible
4 3 2 9 1 8 5 7 6 
3 5 7 8 4 9 2 1 6 
Possible
4 3 6 1 8 2 9 7 5 
3 5 8 9 6 7 4 1 2 
Possible
2 7 4 5 6 3 9 1 8 
4 3 1 8 7 5 2 9 6 
Possible
5 4 9 8 7 3 1 2 6 
8 9 5 7 4 3 2 6 1 
Possible
6 9 4 5 3 8 2 7 1 
9 4 2 8 6 3 1 5 7 
Possible
8 1 6 9 3...

result:

ok 11111/11111 are 'Possible' (11111 test cases)

Test #21:

score: 0
Accepted
time: 35ms
memory: 3680kb

input:

10000
10
4 1 5 7 2 9 10 3 8 6
10
8 7 9 4 5 3 10 1 2 6
10
2 9 10 4 8 6 1 7 3 5
10
7 2 8 5 4 3 1 10 6 9
10
1 9 5 10 6 7 4 3 8 2
10
5 3 9 1 10 4 8 2 7 6
10
2 1 9 8 7 6 4 3 5 10
10
3 1 5 8 7 9 10 4 6 2
10
2 3 1 5 10 9 4 8 6 7
10
3 8 5 10 7 4 6 9 1 2
10
2 9 10 3 6 1 7 8 4 5
10
3 10 6 5 4 2 8 1 9 7
10
6 7...

output:

Possible
9 10 2 5 4 1 6 7 3 8 
3 4 10 6 9 2 5 1 7 8 
Possible
3 4 7 10 6 2 1 9 8 5 
9 8 5 2 10 4 6 7 1 3 
Possible
2 6 5 1 8 7 9 10 3 4 
6 4 7 10 8 2 5 3 1 9 
Possible
8 1 10 7 3 5 2 6 4 9 
4 7 8 6 9 10 2 5 3 1 
Possible
4 7 9 5 1 2 3 6 10 8 
5 9 10 2 7 4 8 3 6 1 
Possible
3 4 5 9 8 1 6 10 2 7 
2 5 ...

result:

ok 10000/10000 are 'Possible' (10000 test cases)

Test #22:

score: 0
Accepted
time: 33ms
memory: 3628kb

input:

5000
20
4 12 9 1 10 14 16 15 5 19 13 2 20 17 6 7 18 8 3 11
20
2 14 9 5 19 1 6 16 8 3 13 11 15 18 20 7 10 17 4 12
20
3 12 16 19 13 5 7 15 10 2 14 1 6 20 11 17 4 18 9 8
20
8 14 12 3 15 1 6 2 19 9 10 16 11 17 18 20 7 5 4 13
20
20 14 17 13 2 6 8 1 9 16 5 18 7 11 10 15 3 19 12 4
20
14 4 12 13 17 18 5 1 3...

output:

Possible
3 8 14 10 12 11 19 5 4 1 18 6 20 17 16 13 2 15 9 7 
9 5 7 10 19 18 15 11 1 8 13 17 6 12 2 20 3 14 4 16 
Possible
4 20 6 17 15 11 1 18 7 13 10 3 14 5 8 9 12 2 16 19 
3 7 11 20 1 9 19 16 12 4 17 2 6 18 10 15 8 13 14 5 
Possible
8 12 4 14 17 9 15 7 5 20 16 18 1 2 3 19 10 6 11 13 
2 17 13 5 18 ...

result:

ok 5000/5000 are 'Possible' (5000 test cases)

Test #23:

score: 0
Accepted
time: 35ms
memory: 3684kb

input:

2000
50
14 32 18 15 19 25 38 17 35 39 45 1 23 26 16 41 27 44 6 3 48 33 46 47 36 31 22 24 34 21 7 50 42 28 8 10 9 20 37 2 40 5 29 13 43 30 11 49 12 4
50
7 34 49 27 22 8 17 35 50 4 45 48 10 13 16 18 31 44 3 11 25 28 20 19 30 33 12 42 38 40 23 14 2 24 47 37 9 21 43 29 36 15 39 6 5 46 41 26 32 1
50
26 3...

output:

Possible
24 20 46 18 6 7 13 38 34 25 40 2 4 12 14 42 26 39 21 15 1 41 19 27 35 49 23 8 22 45 11 37 16 9 29 33 43 36 17 5 28 30 32 50 48 10 44 47 3 31 
14 11 2 44 16 23 50 25 32 38 48 26 47 21 13 20 28 49 40 8 42 24 7 41 5 15 39 9 37 3 17 12 29 35 34 10 18 6 46 22 33 36 30 4 31 27 1 19 45 43 
Possibl...

result:

ok 2000/2000 are 'Possible' (2000 test cases)

Test #24:

score: 0
Accepted
time: 34ms
memory: 3732kb

input:

1000
100
22 42 35 33 69 89 18 99 74 26 10 32 2 29 4 21 71 1 48 15 75 3 8 88 95 36 6 87 57 5 63 25 14 41 98 44 47 39 92 40 31 27 28 96 83 81 68 100 53 13 56 72 65 70 52 49 11 50 97 77 76 93 54 43 46 12 62 78 17 34 45 84 91 51 73 30 64 58 85 86 20 19 7 66 55 61 16 60 37 24 59 9 38 80 23 94 67 82 79 90...

output:

Possible
86 28 9 62 20 26 53 77 60 14 24 49 2 55 36 67 54 10 59 40 41 34 100 37 52 15 47 16 48 91 71 69 7 43 81 98 72 27 1 42 32 87 90 80 73 88 35 79 5 92 65 30 31 18 4 61 56 19 58 45 6 85 13 78 39 44 21 11 75 57 89 74 76 25 50 96 93 64 17 22 63 33 23 46 66 38 12 83 3 51 99 70 95 29 68 97 84 82 94 8...

result:

ok 1000/1000 are 'Possible' (1000 test cases)

Test #25:

score: 0
Accepted
time: 23ms
memory: 3692kb

input:

200
500
77 436 150 381 283 26 376 479 28 247 432 220 18 468 31 161 278 49 344 121 396 405 360 193 101 211 367 242 397 419 190 326 312 126 288 164 276 97 98 341 133 488 137 16 358 261 93 287 484 196 209 96 212 103 207 450 223 200 117 129 316 85 239 427 213 51 89 62 299 83 27 8 357 218 307 342 36 370 ...

output:

Possible
217 165 304 461 3 286 229 500 110 364 444 64 448 166 422 433 253 136 215 454 274 273 268 379 413 468 138 401 315 453 266 499 38 15 336 147 72 238 179 271 370 141 360 243 129 105 190 41 357 474 120 212 39 46 86 390 432 116 143 201 457 144 235 381 323 125 277 483 45 181 251 396 392 137 246 28...

result:

ok 200/200 are 'Possible' (200 test cases)

Test #26:

score: 0
Accepted
time: 24ms
memory: 3656kb

input:

100
999
492 317 271 238 165 666 407 461 861 645 957 35 4 505 40 522 223 816 402 786 766 1 597 978 698 574 246 8 825 159 630 582 904 93 104 837 959 14 393 247 541 961 281 168 826 118 111 67 211 433 284 136 415 31 838 734 520 449 995 203 437 468 976 482 302 578 320 365 877 152 902 47 762 779 32 926 98...

output:

Possible
408 756 254 445 886 869 811 612 564 778 619 504 753 806 497 1 646 888 53 995 31 405 58 266 925 207 501 333 699 472 442 454 309 932 194 507 416 428 542 298 754 743 164 519 421 893 204 950 698 734 514 635 958 132 704 380 107 636 755 640 576 182 321 904 654 248 110 158 512 841 152 345 675 783 ...

result:

ok 100/100 are 'Possible' (100 test cases)

Test #27:

score: 0
Accepted
time: 33ms
memory: 3804kb

input:

10
10000
3111 9882 6693 1688 8131 1069 7097 714 8452 9810 3869 1071 729 8854 4427 5384 85 6139 4846 6702 9502 7068 4059 2105 9491 1770 5224 6581 4166 3999 2335 3218 2668 5457 4910 3214 5844 7261 6649 6271 3041 8709 7866 6145 3463 3566 2989 462 7977 9614 981 8807 7698 4206 7411 4177 4847 9099 6432 92...

output:

Possible
5575 5259 4913 7305 3687 9944 7728 874 6827 2985 5297 7759 3765 8718 1247 3810 6278 5284 9122 3191 7555 7389 2603 5263 4969 5538 3955 7531 4941 3577 2644 2944 4645 5744 5037 6475 9398 2569 3466 9637 8256 1144 1795 523 1562 2666 5699 9502 1073 3044 754 7312 7340 2786 1257 1658 4892 5630 3473...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #28:

score: 0
Accepted
time: 32ms
memory: 3936kb

input:

4
25000
6613 4159 5077 6416 10853 11758 19627 3323 13008 9184 24741 15029 23038 5888 13877 5159 19819 548 11043 7270 23193 10331 4614 20092 14776 4140 1242 12624 5245 9350 18136 16339 10085 144 10843 22439 1999 17054 8601 5862 4359 23951 17309 19743 17748 11856 16787 12426 15536 15452 8084 3441 1124...

output:

Possible
19102 10316 3316 18153 18203 20914 10174 20977 22602 6859 9019 22719 16889 10629 6289 19679 1278 24543 14908 6703 12877 8776 10601 21800 17343 22396 15183 1207 9867 19373 5413 10703 15005 15636 15812 14622 11781 17711 21626 15934 11065 2813 1732 23700 8661 13217 22111 3248 21039 23838 5529 ...

result:

ok 4/4 are 'Possible' (4 test cases)

Test #29:

score: 0
Accepted
time: 29ms
memory: 4464kb

input:

2
50000
5329 24260 36130 8263 35267 32974 10730 5906 40902 11705 34044 1969 19662 22885 12991 17360 37276 2776 42315 20422 42407 15540 15343 37918 33817 17008 3819 43482 47574 2295 38031 48887 34560 4433 63 40770 38505 38533 20662 4570 48598 40935 17641 38040 21430 44656 20895 12229 37373 16553 1899...

output:

Possible
42885 26691 6042 14444 16079 49219 2508 12796 18724 14028 35231 27490 35297 13616 39426 4121 32472 29597 43000 3923 42544 35232 31785 7073 39458 34896 36729 20610 31980 32655 14580 45385 45600 46927 22276 25889 32329 12682 40545 32012 2735 17150 33982 34576 23252 1843 17033 43845 21772 1000...

result:

ok 2/2 are 'Possible' (2 test cases)

Test #30:

score: 0
Accepted
time: 37ms
memory: 5688kb

input:

1
100000
1456 10467 94596 93046 95142 5409 19197 52637 61524 20378 74780 30541 95011 8643 1935 79348 81628 5730 51030 2312 97930 12785 95868 27975 73166 19014 87353 19042 92944 15402 71296 8034 87026 16769 84343 52312 83816 56882 26772 1677 96185 84098 77869 84708 44840 97529 63101 33635 32991 72941...

output:

Possible
25434 27004 88052 96818 83198 34349 54210 88705 90541 3078 51540 38608 84171 78717 76315 86890 30032 84056 27035 43521 55326 18898 62070 18751 42385 87155 88103 71338 45445 27007 44481 23370 5685 26628 66040 93687 65002 24119 45461 89062 81876 91908 13246 93461 22431 39454 25299 37683 94549...

result:

ok 1/1 are 'Possible' (1 test case)

Test #31:

score: 0
Accepted
time: 27ms
memory: 3764kb

input:

10
10000
9496 8510 5460 3882 9615 1884 9371 1347 2879 2204 1543 900 5335 7779 7158 9126 3389 2229 5657 9220 8544 292 7228 7694 6697 8481 4895 5629 2223 1042 747 4220 2587 2589 1797 4720 5129 8687 9083 2076 645 261 6409 4763 3550 8977 9687 6622 1772 6109 8593 9900 1160 5451 580 9252 4132 8214 8831 26...

output:

Possible
9583 3806 6972 389 4747 6831 2518 8540 1280 7153 7574 9219 4863 3678 2660 2071 792 8030 5949 315 6774 5841 7310 4113 398 8860 1993 2625 8907 8191 1422 2079 1396 307 1445 5506 1608 5861 7496 3094 9419 9539 8222 1680 9286 5248 8142 8601 7537 3671 5409 2263 4415 4961 590 5650 3762 758 9383 646...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #32:

score: 0
Accepted
time: 28ms
memory: 3884kb

input:

10
10000
2178 9218 7790 6366 8922 8404 4623 6637 3277 1874 915 9957 4033 7453 1816 5053 9847 5965 5715 4415 2216 9210 1761 8601 2444 3984 3709 853 2766 7651 7721 3449 3630 1316 8822 3779 7268 1794 2824 5596 1612 8132 2267 4317 5800 1975 1555 7042 3374 2174 2792 4275 1465 1152 1664 1299 8439 4566 393...

output:

Possible
8382 1797 4988 6700 3532 6222 8701 4132 710 7707 3763 8948 9819 5080 2278 4305 7956 8498 2902 2878 2057 3664 3685 736 3838 1634 522 3641 716 9098 9067 2138 7123 8889 6011 1170 4640 7005 74 6554 5771 4390 225 5032 3461 782 1041 7185 5005 3489 8629 8941 3979 2406 5285 1346 2351 9615 4962 1598...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #33:

score: 0
Accepted
time: 38ms
memory: 3808kb

input:

10
10000
1567 6252 6443 7699 5492 1842 5405 7366 5587 3056 823 2622 1657 8753 3495 8410 3647 4249 4082 3119 707 3854 7694 784 7418 4856 839 7692 396 1383 1981 5426 8682 2034 206 7122 1159 6858 7121 9028 2891 685 8678 9171 2704 6389 1691 9932 1059 3896 5603 6714 6524 368 7905 78 1591 8160 9729 754 74...

output:

Possible
9583 3806 6972 389 4747 6831 2518 8540 1280 7153 7574 9219 4863 3678 2660 2071 792 8030 5949 315 6774 5841 7310 4113 398 8860 1993 2625 8907 8191 1422 2079 1396 307 1445 5506 1608 5861 7496 3094 9419 9539 8222 1680 9286 5248 8142 8601 7537 3671 5409 2263 4415 4961 590 5650 3762 758 9383 646...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #34:

score: 0
Accepted
time: 25ms
memory: 3852kb

input:

10
10000
4162 9101 9530 2624 3295 4976 2222 5812 6275 4390 1091 9646 7781 9877 9289 9643 1501 1663 4556 1782 7746 8721 993 9177 3081 3633 7243 8477 9458 2546 996 5746 558 7802 8078 2409 6141 2706 1948 2944 6185 3436 5910 4260 185 5584 6409 8392 5007 3815 1452 7181 8849 7937 9709 4059 9237 6013 5154 ...

output:

Possible
1407 5869 2278 3302 4491 2214 7702 126 157 6852 9660 9457 6551 4421 4126 6448 3274 7302 3064 7744 312 7169 7871 6495 9623 4 6200 4617 6414 2200 911 1222 7602 814 6602 7924 978 642 3823 9083 700 4662 8178 368 2798 6175 6381 9509 3562 5648 3925 1337 2338 376 2858 1112 609 6717 3382 6711 9755 ...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #35:

score: 0
Accepted
time: 38ms
memory: 3804kb

input:

10
10000
7169 9888 3050 8344 6010 7824 9030 8457 8512 9823 9850 5216 6614 6527 1137 7044 2122 5052 5373 2616 8293 307 3075 7926 774 2501 9717 3719 69 8190 2413 97 5898 7720 1699 9045 1080 6644 5138 752 3353 9457 4587 2101 5997 970 3009 365 6674 8299 1291 241 6725 7421 235 2938 207 6417 8647 4982 515...

output:

Possible
1407 5869 2278 3302 4491 2214 7702 126 157 6852 9660 9457 6551 4421 4126 6448 3274 7302 3064 7744 312 7169 7871 6495 9623 4 6200 4617 6414 2200 911 1222 7602 814 6602 7924 978 642 3823 9083 700 4662 8178 368 2798 6175 6381 9509 3562 5648 3925 1337 2338 376 2858 1112 609 6717 3382 6711 9755 ...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #36:

score: 0
Accepted
time: 36ms
memory: 3844kb

input:

10
10000
4218 344 9453 2250 6540 174 5484 7282 5757 10000 7819 6405 1570 6813 5519 6500 2164 9737 7708 9517 6059 5969 3481 1963 8644 2957 717 5872 1966 3391 8293 3199 7147 6667 6146 5545 7635 6348 818 4785 6291 3478 2677 431 3934 1878 7228 2711 6850 9995 5922 3144 7235 8773 4271 2232 5820 2375 725 7...

output:

Possible
4809 4324 4807 1507 5373 5091 133 8745 2525 2417 453 5739 6786 5704 2026 4382 8888 1950 7918 8490 5871 1842 5394 833 8159 2806 715 8432 1078 9329 6504 7439 9953 1940 3974 2575 5092 3088 8878 1453 9675 2614 9445 6548 3608 729 4144 6290 4317 4079 9076 4066 5840 858 114 4310 4455 6927 8090 659...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #37:

score: 0
Accepted
time: 31ms
memory: 3860kb

input:

10
10000
4510 8103 8711 5998 7077 4929 4717 8436 4500 2241 6776 4322 528 7714 7357 1411 8862 3226 7694 9239 4118 9336 5424 3055 4796 1260 2569 4967 6361 6452 7687 8565 3083 6256 9369 963 5140 344 8358 6603 8293 1222 2486 5667 8568 3027 7683 7855 6489 2424 3312 5086 9224 3769 3952 5566 9849 2778 1088...

output:

Possible
277 2660 106 6768 5335 9299 1233 6829 272 9541 9944 4823 653 1605 3057 9830 5488 5207 2792 1283 3388 8572 8466 8929 9254 9408 9346 3301 5878 2622 8389 4322 8648 2500 9886 443 7505 6598 8444 4444 4582 7290 7916 7037 6411 4424 8601 8974 8685 2196 9274 1359 4419 3558 6381 3791 8873 3563 6764 3...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #38:

score: 0
Accepted
time: 26ms
memory: 3796kb

input:

10
10000
7627 4696 3738 4879 7371 1232 6843 5355 8688 5927 8229 1973 509 5349 4523 1269 9603 1902 8294 9679 3066 5702 6749 168 855 9149 2615 5826 5373 585 4768 8194 5977 4418 6556 2850 9475 5651 5756 293 1993 8637 367 6975 3377 889 4867 3130 8847 2668 2854 5466 9765 1895 230 439 4416 7213 4888 8060 ...

output:

Possible
2173 9734 1441 7515 4900 3112 4626 4990 1533 3001 8981 4799 4794 3004 4637 6681 7881 4569 9314 5704 4187 1210 9921 3828 5735 116 7670 1462 8255 4553 344 3412 6324 8183 7331 9768 2123 1668 7450 2241 9153 4727 7576 1086 1725 4280 5847 677 8332 8230 8463 8620 1394 2660 1627 8292 1018 3247 3477...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #39:

score: 0
Accepted
time: 34ms
memory: 3808kb

input:

10
10000
3717 2786 9484 9828 3759 346 5412 5491 2997 6494 7048 7489 6711 278 9539 619 3780 1167 2457 9173 180 6257 3085 9695 7034 8748 4260 9925 2654 6969 2663 2176 1114 9476 1405 306 6548 9601 4534 5879 7800 4523 3132 8461 796 6364 9689 2345 2496 5862 9478 6605 6306 1964 1846 6623 2502 742 5326 417...

output:

Possible
3724 7185 5877 655 2986 7497 5700 9642 9653 9592 2391 1598 6551 3671 7806 68 5315 6490 9036 8362 9751 7818 7728 544 716 297 2098 6718 437 1716 4432 9057 1597 6899 4656 5713 9651 8317 6794 6773 2327 2069 1566 2553 4612 7522 3259 1466 5593 1592 8596 7004 1153 5217 9044 337 404 3636 4465 7756 ...

result:

ok 10/10 are 'Possible' (10 test cases)

Test #40:

score: 0
Accepted
time: 29ms
memory: 5796kb

input:

1
100000
7210 30744 81874 6285 69296 6115 79138 52424 44282 14840 1587 38580 10637 93401 83715 42733 75136 14685 64770 3552 44547 86767 94004 99217 2250 68390 11413 7847 90110 73187 70660 79544 7994 78601 79203 34166 47060 92554 22975 17834 25249 63503 18594 15442 31402 21637 9208 82986 75248 10369 ...

output:

Possible
6121 17610 5923 86146 85819 43449 70573 1293 60135 90585 24227 73601 57563 74194 58993 71002 61045 33386 73706 74829 13728 25905 49490 1342 64848 852 52094 61262 86737 4567 50250 17015 82201 36449 37734 31836 53539 34698 37584 4905 27893 13237 6247 37615 83968 57741 75435 23569 40988 57027 ...

result:

ok 1/1 are 'Possible' (1 test case)

Test #41:

score: 0
Accepted
time: 39ms
memory: 5784kb

input:

1
100000
70563 7751 11771 31815 69604 71562 95485 40936 31055 25792 34133 2630 27332 48674 7074 88282 46065 36326 48345 45816 81539 98511 5048 72788 49835 88788 59711 45304 22969 61410 68373 78297 93370 19304 22236 23681 48019 17714 30702 18951 22114 57144 73821 92614 16405 23902 53004 36729 29213 9...

output:

Possible
21480 90482 5081 95018 7442 40846 7172 89833 57257 85795 30021 39980 19593 14497 60322 90197 64289 17174 66487 74706 70232 97139 37145 82186 14913 49421 83315 87867 49778 26046 88683 24518 21455 60232 84870 90880 65220 28206 68899 77952 78289 77121 92235 36055 20964 76375 12040 91038 73022 ...

result:

ok 1/1 are 'Possible' (1 test case)

Test #42:

score: 0
Accepted
time: 31ms
memory: 5716kb

input:

1
100000
33413 95902 66707 37171 63717 97678 10879 3614 34432 20249 89228 27610 94980 80741 33412 55214 41220 52034 92244 16703 23322 64378 89911 94268 48792 70327 31398 74518 38251 72313 17385 90894 32244 4118 33031 22074 73597 51522 18274 49387 15317 43002 18849 63998 36602 55730 85751 93866 86271...

output:

Possible
10058 79438 26097 37679 58932 58098 98052 4669 74131 30929 54595 99095 29906 42975 45027 76307 42513 95511 44617 80882 97448 98507 43372 94080 23155 11438 16734 61615 94146 83211 16874 30265 28254 80256 1158 66143 53861 3695 95290 64556 69877 92984 52377 47881 69953 28650 3319 25005 35622 4...

result:

ok 1/1 are 'Possible' (1 test case)

Test #43:

score: 0
Accepted
time: 51ms
memory: 5724kb

input:

1
100000
38939 36462 49236 11864 41866 9135 83157 68975 57929 22445 15930 71622 6685 74844 63484 21437 36291 19858 96434 77081 5526 27871 28539 29249 81884 33811 86021 19329 4667 40618 83290 68312 3253 19686 13848 64686 67676 20614 87922 14493 2686 23288 80722 55653 55053 42533 20505 82814 3906 7159...

output:

Possible
34628 78172 77266 86733 48880 18717 94174 88626 11993 87524 50733 29088 47418 47672 51655 66484 82476 35789 63139 98016 29447 74703 99966 28517 17551 505 14749 44328 87216 10401 38538 59157 84258 55556 76070 43195 79230 48014 61752 37556 50202 9831 46256 58261 52287 67097 80854 12365 49247 ...

result:

ok 1/1 are 'Possible' (1 test case)

Test #44:

score: 0
Accepted
time: 52ms
memory: 5664kb

input:

1
100000
56410 55223 89128 10706 65945 98487 8157 37051 23481 13806 5708 53223 41255 72197 4250 33306 82551 92413 78735 24394 33722 62458 49977 19569 15457 97352 68219 60151 33432 36755 29808 18535 91202 559 26286 32530 45839 58284 3132 92142 31443 64432 45232 60417 75658 93565 66480 95677 93242 353...

output:

Possible
64683 73051 17636 89472 81191 90919 49138 52834 14121 88226 85001 70102 16257 75781 46389 29959 78950 97292 21899 26521 30333 78360 39234 92007 86690 77318 8104 44906 85348 26382 78138 37074 37228 52439 18982 41146 72594 57372 54416 9240 78325 54389 45442 52686 82003 52212 42354 1824 21565 ...

result:

ok 1/1 are 'Possible' (1 test case)

Test #45:

score: 0
Accepted
time: 24ms
memory: 5648kb

input:

1
100000
92846 36298 94102 74728 62298 17712 70468 29085 26866 74943 50194 68114 23001 42022 1534 67883 22067 31802 76367 40 10506 5204 6633 47834 14730 42455 57533 57800 69803 85998 87243 39377 14734 4609 14172 68549 15757 44430 47282 66093 37600 6662 80279 54115 61844 39518 2508 88635 30432 16795 ...

output:

Possible
83701 6326 74970 22583 68471 69849 16159 63894 38631 93819 82082 71444 97925 95147 87685 83490 10423 86897 24941 57294 49822 89552 64472 43516 28107 66076 68486 16632 12616 27270 74418 38043 73049 7622 39698 39730 36032 64630 14446 43866 29129 34392 36512 51155 8690 49592 23542 49621 8099 4...

result:

ok 1/1 are 'Possible' (1 test case)

Test #46:

score: 0
Accepted
time: 28ms
memory: 5780kb

input:

1
100000
80249 61559 4136 5015 44391 76486 13189 7497 82608 50643 67643 98730 1372 52259 53113 69217 81937 63901 49868 23522 20692 79953 83998 38103 11847 94930 84641 55771 27259 62537 48000 86586 60900 86524 54701 15031 89203 24691 97682 73417 59806 35351 26783 95563 34915 61247 88409 42983 21153 8...

output:

Possible
83701 6326 74970 22583 68471 69849 16159 63894 38631 93819 82082 71444 97925 95147 87685 83490 10423 86897 24941 57294 49822 89552 64472 43516 28107 66076 68486 16632 12616 27270 74418 38043 73049 7622 39698 39730 36032 64630 14446 43866 29129 34392 36512 51155 8690 49592 23542 49621 8099 4...

result:

ok 1/1 are 'Possible' (1 test case)

Test #47:

score: 0
Accepted
time: 34ms
memory: 5740kb

input:

1
100000
47933 91823 8680 38452 98002 50208 28599 87139 73543 26971 73442 64562 24616 52949 43109 48263 71188 90073 98556 71141 35002 1318 47482 55519 52705 70983 13651 91244 53258 35004 5173 13432 8649 2930 60237 98310 56868 28611 2019 3477 57819 51659 892 49301 47016 7551 23697 89821 47998 32736 2...

output:

Possible
690 89605 31587 61151 46988 54315 93734 15166 14522 53521 99896 47666 2904 91630 89224 5377 89660 97255 32113 3738 44711 72367 74985 68 25351 28503 27143 59854 36574 53497 98962 26358 24071 35061 27674 73534 95975 63602 45862 34226 53713 4588 28533 44144 16490 53408 79252 90925 43631 24602 ...

result:

ok 1/1 are 'Possible' (1 test case)

Test #48:

score: 0
Accepted
time: 32ms
memory: 5700kb

input:

1
100000
32591 31819 18269 4992 95481 15309 82223 37862 64829 8548 75956 40622 68213 26870 47574 85646 30288 67079 66288 87221 77650 65875 41974 90346 11987 3782 5691 18237 99521 48974 70063 21886 33587 72262 97090 66592 82785 88943 8082 47016 25506 64005 84545 32684 32875 5661 93415 12006 81882 453...

output:

Possible
3025 83646 94551 20469 94791 36834 62107 62770 5284 81318 35306 74312 8350 68328 7070 16850 38501 98853 83341 59205 31292 23826 32440 24092 19386 77699 13306 82763 74828 93205 93327 71054 10297 99402 5471 31848 58872 32805 20281 64074 69169 50131 30020 67095 853 10992 75110 99340 94931 9433...

result:

ok 1/1 are 'Possible' (1 test case)