QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#584478#7798. Colorful VillagesitablechairAC ✓157ms48552kbC++232.7kb2024-09-23 14:42:342024-09-23 14:42:36

Judging History

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

  • [2024-09-23 14:42:36]
  • 评测
  • 测评结果:AC
  • 用时:157ms
  • 内存:48552kb
  • [2024-09-23 14:42:34]
  • 提交

answer

#include <bits/stdc++.h>

#define ll long long
#define ldb long double
#define endl '\n'
#define For(i,l,r) for(int i=l;i<=r;i++)
#define ForD(i,r,l) for(int i=r;i>=l;i--)
#define REP(i,l,r) For(i,l,r-1)
#define PER(i,r,l) ForD(i,r-1,l)
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
#define All(x,n) x+1,x+1+n
#define Alll(x,n) x,x+n
#define sz(x) (signed)x.size()
#define unq(x) x.resize(unique(all(x))-x.begin())
#define mpa make_pair

#ifdef NCGM
#include"debug.h"
#else 
#define debug(...) "fr";
#endif

using namespace std;

const int N=2e5+3;
vector<int> g_st[N],g[N];
int n,c[N],vs[N],id[N],id1[N],par[N];
int num[N],low[N],cmp[N],numc=0;
bool del[N];
int tdfs=0;
stack<int> st;
vector<int> sobsob;

void predfs(int u,int p=0) {
    for(auto v: g[u]) 
        if (v!=p) {
            par[v]=u;
            predfs(v,u);
        }
}
void dfs(int u) {
    num[u]=low[u]=++tdfs;
    st.push(u);
    for(auto v: g_st[u]) {
        if (del[v]) continue;
        if (!num[v]) {
            dfs(v);
            low[u]=min(low[u],low[v]);
        } else low[u]=min(low[u],num[v]);
    }
    if (low[u]==num[u]) {
        int v=-1;
        numc++;
        do {
            v=st.top();
            cmp[v]=numc;
            del[v]=1;
            st.pop();
        } while(v!=u);
    }
}
inline int nt(int x) {
    return (x>n?x-n:x+n);
}
vector<int> find_sol(int x) {
    vector<int> res;
    For(i,1,2*n) g_st[i].clear();
    par[x]=0;
    predfs(x);
    For(i,1,2*n) 
        if (par[i]) {
            g_st[nt(par[i])].pb(nt(i));
            g_st[i].pb(par[i]);
        }
    fill(num,num+2*n+1,0);
    fill(del,del+2*n+1,0);
    fill(low,low+2*n+1,0);
    tdfs=numc=0;
    while(sz(st)) st.pop();
    For(i,1,2*n) if (!num[i]) dfs(i);
    For(i,1,n) 
        if (cmp[i]==cmp[i+n]) return res;
    For(i,1,n) {
        if (cmp[i]<cmp[nt(i)]) res.pb(i);
        else res.pb(nt(i));
    }
    return res;
    
}
void solve() {
    cin >> n;
    For(i,1,2*n) {
        cin >> c[i];
        if (vs[c[i]]) id[i]=c[i]+n;
        else id[i]=c[i];
        id1[id[i]]=i;
        vs[c[i]]=1;
    }
    For(i,1,2*n-1) {
        int u,v;
        cin >> u >> v;
        u=id[u],v=id[v];
        g[u].pb(v);
        g[v].pb(u);
    }
    sobsob.clear();
    sobsob=find_sol(n+1);
    if (!sz(sobsob)) sobsob=find_sol(1);
    if (!sz(sobsob)) cout << -1;
    else for(auto el: sobsob) cout << id1[el] << " ";
    For(i,1,n) vs[i]=0;
    For(i,1,n*2) g_st[i].clear(),g[i].clear();
    cout << endl;
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    int t=1;
    cin >> t;
    while(t--) solve();
    return 0;
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

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

input:

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

output:

3 7 2 5 
-1

result:

ok ok, 1 yes, 1 no (2 test cases)

Test #2:

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

input:

1
1
1 1
1 2

output:

2 

result:

ok ok, 1 yes, 0 no (1 test case)

Test #3:

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

input:

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

output:

2 
2 
5 6 1 
4 7 2 5 
2 

result:

ok ok, 5 yes, 0 no (5 test cases)

Test #4:

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

input:

10
3
3 2 3 1 1 2
3 1
3 4
2 5
5 3
6 4
15
8 9 13 12 2 4 11 15 10 10 1 12 8 6 15 7 9 5 3 6 14 14 13 3 1 7 11 5 4 2
24 30
1 26
2 16
4 7
30 19
3 19
13 11
21 25
23 22
30 4
19 27
17 26
16 17
21 7
23 25
15 11
10 8
4 16
2 11
14 16
5 10
22 6
11 5
21 18
15 29
24 9
28 19
23 12
13 20
23
21 20 5 9 18 20 21 9 3 6 ...

output:

5 2 3 
-1
-1
-1
-1
1 6 2 5 3 
9 8 1 2 5 
2 7 13 12 16 9 4 14 
17 21 8 13 1 20 18 19 14 9 16 
-1

result:

ok ok, 5 yes, 5 no (10 test cases)

Test #5:

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

input:

100
12
1 2 2 8 10 9 12 11 10 4 12 6 9 3 3 7 5 1 7 6 11 5 8 4
6 5
24 7
2 12
11 3
20 15
8 10
7 10
18 16
15 14
19 2
10 14
18 14
9 14
17 5
12 18
4 23
5 20
10 13
1 4
16 22
11 2
3 21
4 24
2
1 2 1 2
2 1
3 4
1 3
3
1 1 2 2 3 3
1 4
6 4
4 5
2 6
3 4
8
1 8 6 8 4 6 7 5 5 7 4 3 2 1 2 3
9 3
2 16
8 10
1 13
13 2
13 1...

output:

-1
3 4 
2 4 6 
14 13 16 11 9 3 7 2 
6 1 3 
-1
2 
5 6 2 8 
16 5 3 22 9 24 19 14 27 10 1 20 11 6 
6 2 11 9 1 15 7 8 
-1
8 30 38 29 39 14 34 24 2 3 36 27 25 13 5 4 7 28 20 31 
-1
2 
3 17 9 19 13 1 15 7 16 2 
6 5 2 
-1
-1
-1
2 
2 
12 11 3 1 9 15 5 2 
6 2 5 1 
3 1 
2 
2 
-1
-1
9 4 2 1 5 
6 5 3 
7 8 11 10...

result:

ok ok, 65 yes, 35 no (100 test cases)

Test #6:

score: 0
Accepted
time: 6ms
memory: 9728kb

input:

1000
14
6 14 2 9 1 6 12 7 1 11 12 9 3 4 8 7 10 14 13 3 5 8 10 11 2 4 13 5
27 25
21 5
8 14
10 18
17 13
22 12
25 22
27 1
16 7
3 5
10 15
4 14
24 14
16 23
5 11
7 27
12 15
8 2
7 14
6 16
10 3
7 26
6 9
19 22
24 20
13 26
9 28
12
4 12 10 11 9 10 7 2 8 9 8 2 6 6 11 3 3 7 5 12 5 1 4 1
13 18
1 23
23 11
8 17
13 ...

output:

-1
-1
5 6 1 
16 2 10 11 19 18 7 14 8 20 5 1 9 23 
2 4 
-1
2 
-1
4 5 15 19 3 11 1 2 6 10 
-1
6 4 1 5 
4 17 13 10 8 21 5 20 22 9 11 
-1
6 7 1 8 
2 3 4 7 
-1
5 4 7 3 
3 1 
8 24 27 3 30 18 12 15 11 9 23 19 14 17 1 
23 26 10 24 1 5 22 16 13 14 17 9 8 
6 12 9 2 4 11 
10 4 2 11 12 1 
-1
-1
2 7 5 4 
2 
2 
8...

result:

ok ok, 617 yes, 383 no (1000 test cases)

Test #7:

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

input:

100000
1
1 1
2 1
1
1 1
2 1
1
1 1
2 1
1
1 1
1 2
1
1 1
2 1
1
1 1
1 2
1
1 1
1 2
1
1 1
1 2
1
1 1
1 2
1
1 1
1 2
1
1 1
1 2
1
1 1
1 2
1
1 1
1 2
1
1 1
2 1
1
1 1
2 1
1
1 1
2 1
1
1 1
2 1
1
1 1
1 2
1
1 1
1 2
1
1 1
2 1
1
1 1
2 1
1
1 1
1 2
1
1 1
2 1
1
1 1
1 2
1
1 1
1 2
1
1 1
1 2
1
1 1
2 1
1
1 1
1 2
1
1 1
2 1
1
1...

output:

2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
2 
...

result:

ok ok, 100000 yes, 0 no (100000 test cases)

Test #8:

score: 0
Accepted
time: 41ms
memory: 7912kb

input:

10000
8
2 8 3 1 5 7 6 2 5 3 1 6 4 7 4 8
14 10
7 10
15 7
14 6
14 13
8 7
16 1
5 7
9 14
4 5
11 12
13 16
2 13
11 10
3 4
6
3 3 6 5 2 4 4 1 6 2 5 1
7 6
9 1
2 12
4 6
8 4
12 10
5 10
11 7
8 10
3 4
9 7
56
29 10 48 24 2 5 45 30 18 28 51 14 18 55 50 5 19 38 43 14 28 7 46 1 7 20 38 31 20 22 33 30 32 12 55 15 4 5...

output:

11 1 10 13 5 7 14 16 
-1
-1
6 2 7 5 
8 4 10 1 6 
2 
-1
2 3 4 
20 6 21 15 7 13 10 11 22 3 18 4 
-1
2 
-1
2 
2 
1 2 10 3 4 
16 2 18 1 4 6 3 9 10 13 
6 10 20 8 14 3 22 7 21 13 9 
3 6 7 2 4 
-1
2 
-1
1 3 4 2 10 
-1
-1
3 6 2 14 15 7 13 11 
-1
3 22 27 34 28 6 7 25 31 8 21 20 32 13 29 15 9 
15 6 14 10 1 3 ...

result:

ok ok, 6241 yes, 3759 no (10000 test cases)

Test #9:

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

input:

1000
116
50 59 41 49 19 85 9 94 34 77 78 3 113 32 109 17 103 56 47 41 64 99 28 114 14 55 97 12 63 105 84 81 54 5 13 15 101 20 39 96 48 112 14 97 76 88 67 75 6 32 108 11 87 39 57 11 49 18 36 110 104 31 58 73 72 66 89 115 8 61 55 62 6 10 25 4 115 1 112 21 53 111 51 69 27 56 82 24 30 106 30 80 35 65 10...

output:

-1
-1
-1
-1
-1
-1
-1
-1
15 18 4 22 20 25 12 26 3 10 17 16 5 27 
-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
21 7 16 20 14 22 3 4 10 9 1 13 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2 5 6 4 12 3 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
7 1 ...

result:

ok ok, 114 yes, 886 no (1000 test cases)

Test #10:

score: 0
Accepted
time: 49ms
memory: 11108kb

input:

100
1751
1420 521 90 1373 1093 161 1200 1386 1091 1264 1265 1065 1378 1149 306 545 479 1579 1078 151 934 904 1574 1199 1581 952 544 386 867 547 401 1218 1444 652 1486 826 137 860 1050 832 738 455 352 24 1462 1581 532 150 913 213 748 465 1057 539 838 617 1150 1335 573 1692 1590 571 981 752 1697 1452 ...

output:

-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
2 
-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

result:

ok ok, 1 yes, 99 no (100 test cases)

Test #11:

score: 0
Accepted
time: 81ms
memory: 17336kb

input:

10
5923
677 2765 1180 642 3593 131 5590 3281 4786 2499 1862 247 239 3798 3174 2761 1281 1765 937 144 5408 4039 5442 2407 2669 5018 434 1962 319 3944 2812 3472 94 788 3672 5233 3722 4465 3786 2110 2508 1725 518 2460 1594 2334 4106 2411 3758 3669 5343 5236 5481 4963 2978 1374 5119 4233 872 5860 1969 4...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1

result:

ok ok, 0 yes, 10 no (10 test cases)

Test #12:

score: 0
Accepted
time: 94ms
memory: 23920kb

input:

5
792
82 199 76 52 611 658 522 660 521 464 542 179 170 151 363 514 408 538 159 309 476 681 224 384 238 14 551 357 291 226 91 655 520 467 40 314 128 233 157 355 364 394 386 59 104 72 614 153 145 342 288 300 174 481 407 588 479 262 594 562 732 766 549 285 626 197 599 441 677 574 760 265 150 341 379 55...

output:

-1
-1
-1
-1
-1

result:

ok ok, 0 yes, 5 no (5 test cases)

Test #13:

score: 0
Accepted
time: 122ms
memory: 28828kb

input:

2
65032
51765 14585 29531 60818 31717 53669 30002 24136 46046 45852 37859 15627 28019 22633 24814 53657 46742 22317 35902 32550 38630 28432 44926 45040 46668 40981 54500 21394 53384 61536 50714 23630 9738 1938 47244 49378 56790 31848 37735 62084 6455 42036 23897 51900 13479 6676 29212 6843 25442 412...

output:

-1
-1

result:

ok ok, 0 yes, 2 no (2 test cases)

Test #14:

score: 0
Accepted
time: 147ms
memory: 38264kb

input:

1
100000
43998 64955 63238 29708 72934 15147 66162 7126 11537 74378 71915 92992 96861 66894 62532 45592 93798 43980 56960 81282 62242 106 77838 29480 4682 73235 82872 54358 49135 28767 52980 14342 64201 81602 39815 55123 47803 85961 28674 28919 32310 37093 69998 49556 28017 29987 94610 16481 81286 7...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #15:

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

input:

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

output:

2 
2 
6 5 4 
5 3 8 6 
2 

result:

ok ok, 5 yes, 0 no (5 test cases)

Test #16:

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

input:

10
3
3 1 2 3 1 2
3 1
6 4
5 4
5 2
3 2
15
6 3 13 6 1 13 5 10 9 7 11 8 9 10 14 8 12 12 11 14 15 15 3 7 2 4 5 1 2 4
30 28
2 5
9 28
27 4
10 17
9 23
23 16
30 15
8 21
13 1
29 22
28 27
18 17
2 17
12 8
3 25
2 14
4 21
18 7
3 27
11 2
6 24
8 1
6 22
2 21
8 20
29 27
19 22
26 21
23
14 12 18 16 10 23 10 6 13 19 7 2...

output:

5 6 4 
28 29 2 30 27 4 10 12 9 8 11 17 3 15 21 
41 40 17 24 39 8 29 22 42 5 46 2 9 18 21 4 44 3 10 35 23 20 6 
5 6 4 8 
8 1 3 7 4 12 
10 6 2 1 5 
10 6 5 3 1 
5 11 7 15 8 9 10 12 
4 9 6 14 17 13 11 19 22 8 1 
30 23 10 39 16 13 4 35 38 40 33 26 32 1 9 17 31 3 12 28 

result:

ok ok, 10 yes, 0 no (10 test cases)

Test #17:

score: 0
Accepted
time: 3ms
memory: 11976kb

input:

100
12
11 12 8 1 11 2 8 4 9 10 3 3 12 4 5 5 2 7 10 6 6 9 7 1
22 3
18 10
20 17
18 14
12 18
19 6
20 14
2 24
2 7
24 11
2 6
17 15
13 21
20 1
22 17
21 3
9 10
17 4
14 16
14 24
23 12
5 12
8 24
2
2 1 2 1
2 3
4 1
2 4
3
3 1 3 2 2 1
2 6
6 1
2 3
3 5
4 3
8
2 2 1 5 3 7 7 5 1 8 8 4 6 4 3 6
1 9
12 10
12 11
16 5
14 ...

output:

24 17 12 14 16 20 18 3 22 10 5 2 
4 1 
2 4 3 
3 2 5 12 8 16 7 11 
5 6 1 
3 14 4 19 7 6 11 22 24 1 17 21 
2 
7 2 1 4 
12 4 2 5 14 6 26 16 1 18 9 7 13 24 
8 12 16 7 6 1 11 10 
10 15 20 11 13 42 49 48 57 53 37 26 1 12 9 51 27 38 7 23 55 31 2 54 24 44 22 32 50 
28 15 34 31 37 39 20 32 36 38 3 25 24 14 2...

result:

ok ok, 100 yes, 0 no (100 test cases)

Test #18:

score: 0
Accepted
time: 3ms
memory: 7972kb

input:

1000
14
10 2 1 9 14 13 3 7 2 1 8 6 12 5 11 9 5 4 12 11 6 14 13 7 4 8 10 3
26 2
17 24
1 8
26 6
26 10
26 5
14 16
25 8
4 20
3 6
15 5
8 26
19 6
9 16
16 18
20 13
9 28
3 22
23 6
7 12
4 11
8 21
14 6
9 12
17 15
27 12
13 3
12
1 5 4 2 7 12 11 9 10 9 11 4 2 6 3 8 6 5 8 3 12 1 7 10
6 10
22 1
8 21
6 13
3 4
20 19...

output:

10 9 28 18 14 12 8 26 16 27 15 19 6 5 
1 4 15 3 2 17 5 16 8 9 11 21 
6 3 5 
19 6 9 3 24 16 22 21 1 2 23 20 27 10 
4 2 
56 31 14 62 5 53 38 10 43 51 27 32 61 24 3 55 29 17 28 7 59 37 35 12 63 18 48 46 34 39 49 20 
2 
9 3 1 4 17 15 6 13 5 
8 10 4 5 19 13 1 7 3 20 
27 11 9 14 15 28 32 12 33 20 2 25 35 ...

result:

ok ok, 1000 yes, 0 no (1000 test cases)

Test #19:

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

input:

10000
8
8 7 1 5 4 5 6 4 3 2 3 2 7 8 6 1
3 4
1 10
5 9
13 10
15 13
4 8
9 16
6 11
2 16
13 8
12 5
11 10
8 7
16 4
13 14
6
5 2 3 6 6 2 3 1 1 4 5 4
8 11
5 9
11 5
5 3
1 5
5 6
4 5
2 9
10 11
10 12
9 7
56
3 20 46 36 22 34 10 18 54 53 31 52 21 39 26 15 9 51 12 18 10 35 27 44 45 5 7 8 24 43 6 1 48 1 24 25 37 21 ...

output:

16 10 11 8 4 15 13 14 
9 6 3 10 11 5 
32 111 88 94 26 39 27 28 17 21 71 52 93 95 16 69 100 20 78 2 38 97 68 35 81 46 109 101 50 72 86 45 98 103 66 79 37 62 87 44 99 102 53 24 25 91 48 107 89 61 42 12 112 104 105 108 
5 7 6 3 
4 6 7 5 3 
2 
12 2 18 1 6 11 17 10 7 
3 5 4 
21 4 18 8 12 20 15 14 24 9 6 ...

result:

ok ok, 10000 yes, 0 no (10000 test cases)

Test #20:

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

input:

1000
116
70 107 90 74 15 78 57 102 95 114 43 1 47 52 99 96 115 48 66 94 111 77 42 56 35 86 23 41 92 90 57 72 26 12 38 83 51 34 114 79 91 89 20 105 106 87 38 45 89 19 95 110 48 81 63 73 100 108 49 93 61 68 37 30 21 9 110 91 13 32 109 44 44 88 105 107 108 98 85 115 51 59 30 34 29 76 6 112 55 63 54 27 ...

output:

179 213 170 215 133 186 109 176 224 214 209 34 69 93 5 230 157 135 50 43 178 164 163 231 124 33 202 221 85 83 212 156 129 38 25 166 63 35 205 113 28 23 155 73 127 172 177 18 59 136 81 14 196 91 89 158 7 137 187 190 228 181 55 175 139 19 162 62 174 112 161 189 56 4 171 86 143 125 173 195 54 188 36 99...

result:

ok ok, 1000 yes, 0 no (1000 test cases)

Test #21:

score: 0
Accepted
time: 50ms
memory: 9316kb

input:

100
1751
601 846 691 764 938 382 1323 652 1307 1125 1543 206 1044 256 795 581 99 1007 104 1158 1461 757 693 516 1406 1669 1725 1061 1078 509 1480 349 1096 1255 417 524 113 1350 692 1721 513 1608 520 1444 711 605 1731 661 375 362 1182 906 114 369 345 1395 901 1469 994 898 469 203 851 1305 432 924 172...

output:

2023 3130 3132 431 178 2506 1843 2564 809 2254 1861 1695 1852 3466 263 2746 3153 2767 365 1964 1296 1344 3495 1998 534 283 3368 2244 464 1943 2432 3328 1190 2019 1436 1276 1577 2404 2865 836 548 671 897 877 3475 3422 2847 2366 2262 2278 2835 2549 2529 3097 2207 2116 1399 1064 1632 245 687 561 2329 2...

result:

ok ok, 100 yes, 0 no (100 test cases)

Test #22:

score: 0
Accepted
time: 67ms
memory: 14820kb

input:

10
5923
4726 4275 4292 3386 3422 5122 3089 1880 2517 1210 5112 3127 4249 5746 1898 1146 3312 3472 5469 1203 4040 5195 2775 5146 2026 3583 2290 4658 53 1828 2612 2724 5527 4320 458 3644 414 1965 2484 5135 4870 4853 2619 2532 3476 466 1035 5706 2755 1185 4864 147 3509 1530 2634 40 18 2375 1309 1272 13...

output:

10041 6887 4222 9725 9319 10541 6424 1134 3807 6058 8103 1244 61 11475 2662 10062 3894 6951 9763 3061 3424 7936 2768 2231 10481 4888 7859 4583 10130 442 5594 9956 7413 8636 8904 9629 3460 4810 4882 56 2761 435 1479 177 6655 7223 11280 154 6349 10089 7515 5576 29 375 11775 11510 813 1182 4137 1296 70...

result:

ok ok, 10 yes, 0 no (10 test cases)

Test #23:

score: 0
Accepted
time: 82ms
memory: 22284kb

input:

5
792
241 146 280 438 667 528 791 320 636 695 509 329 302 195 475 406 416 202 695 110 720 126 126 61 687 536 516 556 487 230 645 429 158 472 257 622 621 168 282 596 283 787 426 99 568 466 784 701 653 628 26 792 405 348 555 390 518 295 274 98 709 213 324 112 321 362 185 773 558 258 341 446 89 727 463...

output:

599 1555 828 327 1491 1379 793 258 1177 948 919 440 355 1509 537 1541 294 1512 1438 637 703 1040 1359 1331 1572 51 894 1423 1417 352 383 1116 1349 990 1039 1129 273 1020 933 494 564 77 329 1272 290 769 520 469 360 220 1428 1058 981 396 1183 1551 787 1439 1336 512 24 167 1322 92 1570 307 917 1055 238...

result:

ok ok, 5 yes, 0 no (5 test cases)

Test #24:

score: 0
Accepted
time: 107ms
memory: 24304kb

input:

2
65032
31108 45362 36972 47475 30835 45238 35438 34346 54408 16217 30187 46516 32845 8486 50667 28340 40170 60245 44914 6079 49844 47578 17944 49223 25078 64933 45703 34596 57087 10779 44355 57971 31108 60602 63032 58758 54142 32501 4869 21575 49094 29515 50196 40871 2348 29256 25680 2356 27041 114...

output:

123403 23784 36990 72145 78900 58471 8972 46203 38887 77165 44587 89923 74974 16890 120116 112323 119978 68037 30529 67190 104090 5810 265 108547 67361 39918 21997 93111 38412 117815 86783 13625 96007 115835 18012 23488 56998 123532 104802 28705 81883 33217 61409 67356 13607 62514 59974 17603 58823 ...

result:

ok ok, 2 yes, 0 no (2 test cases)

Test #25:

score: 0
Accepted
time: 123ms
memory: 33556kb

input:

1
100000
54369 65296 73213 12642 69538 49720 58551 29396 19567 81566 41157 85204 90311 98174 33925 46773 53346 25489 50176 69753 59 86524 22123 46556 25080 32999 17530 46574 8168 68313 13816 79851 22453 44501 92457 32706 99976 35979 74857 16348 15418 2234 41199 93543 65324 22144 86201 99730 20265 86...

output:

92206 72994 157909 62828 79071 172272 54931 22867 38899 195123 50584 151587 46445 66843 62270 9964 169211 186203 143857 112542 109470 101600 154895 26385 22979 945 31507 110194 104928 93139 47178 21165 3285 167692 144469 68582 31388 100536 5281 892 136017 104124 151746 20764 53950 196503 181612 2463...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #26:

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

input:

33366
3
1 3 2 2 3 1
2 1
2 6
3 2
5 4
4 1
3
1 3 2 1 2 3
1 2
1 6
1 3
5 1
6 4
3
3 2 1 3 1 2
1 2
3 2
6 5
1 4
5 2
3
3 3 2 1 2 1
4 1
6 1
1 2
1 3
5 1
3
3 1 1 2 3 2
4 5
3 2
1 2
6 4
3 5
3
1 2 1 3 3 2
2 1
1 4
3 5
3 6
4 6
3
3 1 3 2 1 2
1 2
5 4
6 1
4 3
3 2
3
2 1 1 3 2 3
2 1
2 6
4 2
1 3
2 5
3
1 3 3 2 1 2
1 2
2 5
...

output:

6 3 2 
1 3 2 
5 2 1 
6 5 1 
3 4 5 
3 6 4 
5 4 3 
2 1 4 
5 6 2 
6 5 1 
4 2 1 
4 1 5 
3 6 4 
-1
5 4 1 
6 1 3 
2 1 5 
5 1 6 
6 4 1 
5 6 4 
4 5 3 
5 1 2 
4 2 3 
5 2 1 
2 4 1 
4 1 5 
2 4 6 
5 2 1 
5 4 6 
4 6 5 
5 1 3 
1 2 3 
5 2 1 
2 1 3 
4 5 1 
2 1 3 
2 6 1 
5 4 3 
6 2 1 
1 5 4 
5 2 1 
4 1 2 
4 2 3 
5 6...

result:

ok ok, 31358 yes, 2008 no (33366 test cases)

Test #27:

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

input:

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

output:

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

result:

ok ok, 22174 yes, 3158 no (25332 test cases)

Test #28:

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

input:

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

output:

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

result:

ok ok, 27245 yes, 473 no (27718 test cases)

Test #29:

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

input:

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

output:

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

result:

ok ok, 19618 yes, 1442 no (21060 test cases)

Test #30:

score: 0
Accepted
time: 94ms
memory: 33448kb

input:

1
100000
25374 18410 84926 88926 21275 4428 46964 65635 43273 80601 72309 29310 43888 50487 5011 47001 44166 36768 80315 20525 47123 10751 67188 78622 54756 81417 76140 53304 12052 8397 62486 30775 61137 96286 67213 50472 98000 24738 83954 16072 41474 80626 60962 28183 91765 48788 23532 3710 25415 3...

output:

96223 48256 174893 78023 112717 24259 60143 185823 160966 83997 36434 197604 128196 43358 55196 125121 13701 117744 109636 9813 52307 130623 73462 148268 82011 147279 125986 149346 56674 100013 127731 75818 80985 116739 108437 75131 127038 46589 193001 66849 10932 183281 124139 14947 185865 97617 78...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #31:

score: 0
Accepted
time: 110ms
memory: 33976kb

input:

1
100000
83987 88389 92327 47441 99047 29806 3505 35961 16075 63594 7441 91401 8988 29442 78002 18772 55003 88608 76455 23773 75366 78344 38291 24136 52381 61959 30007 10672 83461 20868 20733 45468 34650 64249 5753 39454 94382 96653 26727 12741 88877 76692 45571 57416 17680 35352 14023 85291 40103 1...

output:

134083 153273 36901 59934 110896 150432 88101 88221 49559 44175 184645 179860 105737 122776 16291 185149 135706 84305 109562 163610 125979 116642 26481 160976 7818 161785 33271 31303 110016 84085 43452 148511 161783 174521 90656 42086 138966 147287 169339 198777 19092 58202 93835 150077 180755 19490...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #32:

score: 0
Accepted
time: 140ms
memory: 34372kb

input:

1
100000
59671 57055 1321 46192 26278 572 10085 45793 36448 60992 11329 31424 9361 90611 88800 85236 36384 38026 23756 98208 68980 91957 57948 27494 31287 67003 84921 31053 94553 27208 75683 23222 62547 24722 43546 80154 2061 36017 41960 23660 4626 75548 15362 97441 86514 29669 55630 15449 67382 275...

output:

188893 37032 13060 46272 53064 97110 25646 120048 92324 32570 137481 152057 141561 154373 175151 162494 157454 8929 128589 199611 176842 172793 86467 56967 44589 187582 3463 118762 194092 149738 17283 132782 98513 140092 8619 40546 74210 25040 19227 140953 192562 139845 2514 366 195444 163083 78726 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #33:

score: 0
Accepted
time: 141ms
memory: 36460kb

input:

1
100000
68868 65241 72209 73540 53717 86935 37101 1634 71896 84500 33836 99586 40379 92118 97847 19129 9262 63816 28406 20349 2223 51093 73177 95956 49390 78407 60693 88528 57113 85891 77353 32630 53907 29001 24289 10635 17923 65050 88248 6230 26406 5704 79230 54731 35671 70166 74284 21273 52440 99...

output:

19457 151822 3625 107513 84322 3040 176687 45895 147907 160568 78153 24953 24351 17695 69690 35272 7329 166564 88444 63325 178621 176876 19472 107020 40826 174043 20278 90776 64945 135192 17937 77832 41129 1422 6158 182870 104406 158776 158977 94704 3454 5448 138767 134701 198299 19181 39199 164547 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #34:

score: 0
Accepted
time: 157ms
memory: 38948kb

input:

1
100000
60954 13153 14045 51158 55629 81586 59503 65718 72890 17528 93913 27290 110 17470 60800 41601 17656 21604 66017 54760 51230 88771 88551 14559 13850 94357 86983 32608 65083 26103 88864 672 55974 36334 23131 21669 98700 58492 71415 86686 97651 59141 40277 97922 80979 32001 16738 60319 96415 1...

output:

79225 41237 15538 173314 123528 145144 36690 133165 169717 47512 51406 121141 171788 139657 170366 42444 148052 113343 39820 80525 178407 113792 70159 197549 38758 71884 11273 68672 10525 146623 151638 149628 10314 161590 11369 13403 114938 2148 26626 19818 47528 45972 69134 57481 11472 182327 31212...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #35:

score: 0
Accepted
time: 152ms
memory: 37076kb

input:

1
100000
10863 84463 1056 85154 86050 17714 44957 52583 53364 98974 8875 91000 74383 41303 40532 42820 297 13341 26208 68055 19697 82315 72314 56492 2971 40992 74916 9198 26828 65309 53931 8538 3045 55403 79784 49602 82414 75092 9263 21774 67506 20287 1621 65131 98001 53250 20627 25320 37348 38922 7...

output:

95387 61850 133242 15948 121464 199369 199393 38007 40745 17912 59718 198846 173988 29365 29930 48391 84080 176266 84221 192762 66942 115136 143307 73216 74963 50885 1205 131926 17738 60010 87990 117118 136464 76774 46998 54292 98648 185516 58945 5218 14525 187916 44418 189211 162327 72176 13610 777...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #36:

score: 0
Accepted
time: 116ms
memory: 37148kb

input:

1
100000
73950 28723 43789 2024 67480 36149 47960 77820 33846 34217 3961 61257 77124 37451 19488 82334 30989 47363 97602 38384 62192 19260 99254 16797 46576 95907 95717 70095 56841 88473 82540 77437 61193 71619 86664 4405 34593 46624 31969 95177 26333 28123 42541 63196 41956 58802 59592 33848 13640 ...

output:

122927 32932 48186 176734 40040 14684 140081 96953 55341 41322 14012 121742 111942 155611 199384 10784 101039 150796 10959 125968 33927 49295 142275 40865 78319 23613 28255 75479 22780 100604 110807 129058 153437 91957 193463 191718 23686 150677 195776 182204 169836 97536 68829 169300 36355 57956 16...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #37:

score: 0
Accepted
time: 129ms
memory: 37168kb

input:

1
100000
42104 17789 5387 40582 14864 28708 26848 73762 19574 38572 32 48152 9356 15233 27776 68859 45905 18972 33144 30429 71959 86823 25489 71175 24656 32359 54768 6854 31629 38893 98297 25530 58168 11707 53579 82906 85746 23702 50559 57897 76215 13433 6876 97020 14143 634 49195 21397 76861 60845 ...

output:

110355 41536 11098 51370 85328 182612 174664 73292 137024 40864 76930 40959 75884 17329 198867 3074 163940 194253 119823 156404 116735 185694 193368 143270 48079 103783 96874 140738 32578 133691 141031 72324 179874 180814 21209 168187 121046 159462 139696 193112 197986 28355 92809 71549 63990 31497 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #38:

score: 0
Accepted
time: 131ms
memory: 40444kb

input:

1
100000
20124 12338 56629 70577 7428 57363 59215 12672 98118 63378 16207 40412 3732 73087 64525 39238 59347 54314 34578 18073 70273 9702 79662 84111 39473 62248 49424 98382 94627 60195 48594 86166 69668 44636 95784 99033 86459 20223 21735 48650 49668 94186 59975 64908 61551 43159 87151 16849 17014 ...

output:

55982 45930 160655 106892 124199 170275 153331 89855 184488 140372 13101 80214 92275 99426 78446 82444 60243 48980 52157 176162 132230 24789 56633 142893 142371 121183 162032 47643 19745 43420 107616 193824 16311 170952 142290 139153 116630 102853 131764 65500 39675 54666 42216 109402 159863 2154 75...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #39:

score: 0
Accepted
time: 152ms
memory: 38792kb

input:

1
100000
51380 57533 14960 51558 27762 53290 90260 26903 93077 52052 78728 1351 9667 18785 40356 58450 69018 28103 63831 44148 65848 38201 79040 64668 70785 81386 76238 56832 39159 27517 75791 88187 95230 61262 7593 29040 30634 50422 6424 63213 17836 76092 31384 75635 19996 86559 13386 69883 21659 5...

output:

22048 75589 72800 92721 115174 51573 109014 78936 56283 176135 99221 22602 188677 64461 3405 199096 184829 114316 198978 116217 4523 183889 33493 133181 34118 182416 43254 89130 189531 139284 4066 95585 56932 36804 147652 33853 68498 55346 35876 173605 19627 68555 152277 13277 74980 175239 6642 8260...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #40:

score: 0
Accepted
time: 122ms
memory: 38896kb

input:

1
100000
39606 8451 91091 10002 20214 25167 85691 39493 71965 2889 30276 56056 85721 96562 91989 7903 43395 56777 85906 93854 38612 17915 16822 29962 28489 51999 52762 61318 52173 92755 49341 78582 2374 15550 9255 40346 86110 65804 62791 59125 73162 42787 46589 68449 51774 89125 98169 46032 80560 92...

output:

193083 92476 144685 13001 139295 50184 96989 25987 101662 105162 109654 117369 15882 68654 195752 53930 95307 122650 180303 99975 47619 48396 147200 37761 17422 172871 161481 48722 150303 187924 179590 190217 91970 104897 93435 196116 88466 88855 7982 89704 83933 133106 114298 113215 141867 116743 1...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #41:

score: 0
Accepted
time: 113ms
memory: 39584kb

input:

1
100000
59100 82264 60339 14007 89850 88860 37856 94177 7655 64679 55331 78456 80981 64078 70058 69750 60218 23184 636 39839 77349 42452 7105 83234 21489 98356 89317 49807 12366 40919 8206 63072 43620 87306 97218 23632 78524 50746 39840 85928 61007 39865 58583 50385 67685 87807 85301 51546 95562 55...

output:

164636 100989 118925 184526 1966 74000 109206 58896 185616 86804 197574 171613 164401 51547 138178 113710 140464 95128 90484 118745 119909 80915 163685 68695 141410 97180 155765 128647 145197 96669 4295 121620 47250 53003 114238 179000 79603 104226 9719 160146 98823 183428 27092 132119 35529 181259 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #42:

score: 0
Accepted
time: 121ms
memory: 41964kb

input:

1
100000
20490 62757 95997 4280 79388 10348 84532 91919 58854 27628 56833 22912 71709 42582 16652 80348 63233 80986 88459 97682 68739 95886 41509 5781 79268 82446 65249 80179 72008 22538 51066 62947 62354 73809 73235 35914 55118 96023 5045 97 30613 17931 70030 1735 63320 85814 3753 15232 47656 2816 ...

output:

148697 7920 19271 106989 51530 187726 86032 121402 141984 189837 145245 39564 190865 143722 104653 189974 72805 56424 99144 173088 32807 156736 27068 154334 66938 27519 91859 115251 111182 81769 192955 151246 37409 189747 113800 27486 123968 104054 101113 191117 173001 176137 3982 194953 74814 51320...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #43:

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

input:

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

output:

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

result:

ok ok, 50000 yes, 0 no (50000 test cases)

Test #44:

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

input:

10000
13
5 3 11 2 10 10 8 8 7 13 4 12 5 9 13 6 1 12 1 2 6 7 3 4 9 11
2 13
14 10
18 24
23 22
7 4
9 16
25 14
4 17
12 6
11 15
12 24
1 12
13 16
9 8
3 9
26 12
21 3
15 20
19 21
15 7
23 3
9 17
24 4
9 25
5 12
19
11 3 4 13 17 2 7 9 4 1 6 1 12 7 2 19 5 10 16 6 11 12 15 3 14 16 14 9 19 10 17 18 13 15 8 5 8 18
...

output:

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

result:

ok ok, 10000 yes, 0 no (10000 test cases)

Test #45:

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

input:

2000
9
8 6 4 2 5 7 3 7 5 9 9 8 6 1 1 4 2 3
1 4
18 10
11 17
5 12
15 7
3 18
10 4
16 7
5 9
9 13
16 12
13 6
1 14
8 2
6 14
17 8
2 15
4
1 2 1 3 3 4 2 4
8 1
8 2
4 3
7 6
4 2
5 3
7 5
21
16 13 5 20 6 16 11 4 20 9 11 19 17 6 7 10 2 15 10 4 14 21 19 18 1 2 12 21 18 1 13 7 8 17 3 3 14 12 5 9 8 15
41 20
16 32
34 ...

output:

15 17 7 16 5 2 8 12 11 
3 2 4 8 
30 17 36 8 3 5 32 41 40 16 11 38 2 21 42 6 13 29 23 9 22 
81 32 248 255 197 289 36 315 347 133 209 125 302 201 200 72 274 194 58 225 1 71 397 324 84 393 37 8 272 62 310 399 107 76 135 237 355 288 220 169 391 383 358 31 88 47 179 388 229 408 136 296 303 168 98 375 103...

result:

ok ok, 2000 yes, 0 no (2000 test cases)

Test #46:

score: 0
Accepted
time: 41ms
memory: 8136kb

input:

500
756
576 421 409 269 704 661 327 592 532 33 380 501 737 662 335 492 724 335 404 45 185 451 631 558 466 250 585 258 183 240 540 440 475 689 570 199 233 427 592 710 81 61 714 652 642 197 525 619 688 745 239 541 421 208 260 578 714 224 705 1 125 313 728 209 198 637 181 154 42 577 140 586 728 216 716...

output:

60 178 1109 1154 1160 1470 734 1353 858 580 1138 326 870 570 1356 686 796 249 941 388 148 100 901 539 1015 156 794 1046 87 179 288 568 1208 284 1284 1263 578 1123 706 1416 283 240 1355 1077 1155 1132 254 1443 933 1352 1168 634 239 1120 1358 314 1075 532 1103 1024 805 1342 102 448 370 79 579 1404 113...

result:

ok ok, 500 yes, 0 no (500 test cases)

Test #47:

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

input:

100
1899
1849 223 25 1236 389 528 610 804 1811 824 1624 1095 155 1158 1165 706 1451 869 339 922 1116 469 1040 462 1503 1511 1460 1787 955 1864 653 1079 88 928 256 815 833 195 620 1076 1337 798 1494 1540 1315 429 1185 1686 1595 1284 673 1792 127 1353 1390 1027 450 97 1561 1704 1062 1188 1272 856 1854...

output:

487 809 2847 1655 1361 1738 2391 3516 553 402 1440 1640 1813 3110 329 2643 482 1804 1534 642 832 1714 3291 1796 3 3452 1835 1701 2567 3068 3366 450 3570 2818 3307 2883 2017 2524 1764 2038 3248 2648 3200 2896 741 2482 3168 1172 3233 238 2097 3099 2451 3586 3535 2535 3555 2143 1353 229 1184 851 169 19...

result:

ok ok, 100 yes, 0 no (100 test cases)

Test #48:

score: 0
Accepted
time: 70ms
memory: 12824kb

input:

20
269
175 261 168 180 259 240 111 263 115 198 68 144 237 197 30 123 227 147 152 189 54 192 49 14 58 176 150 269 230 68 178 262 263 221 98 141 137 119 100 249 153 122 76 220 45 155 248 36 145 174 57 29 157 27 124 176 133 133 142 103 235 3 21 6 92 114 25 233 153 250 226 45 97 195 73 7 109 6 121 182 2...

output:

242 417 62 319 279 78 167 179 157 153 533 196 484 24 460 261 359 232 306 523 415 428 492 441 514 241 54 521 370 165 435 534 489 355 246 302 245 291 98 93 273 461 385 488 72 387 129 498 220 330 260 348 97 333 504 161 357 25 391 214 240 400 215 190 277 340 373 30 233 528 502 248 75 296 216 213 338 429...

result:

ok ok, 20 yes, 0 no (20 test cases)

Test #49:

score: 0
Accepted
time: 77ms
memory: 20384kb

input:

5
12543
753 4983 7066 11075 8296 6675 5430 6021 237 3895 2240 895 1266 10538 4334 8662 2796 1259 7614 8052 2638 5029 613 12523 9630 2756 1102 2404 6639 4656 6019 12532 8952 9865 11603 2654 8528 11303 1759 11657 7998 3972 11243 5467 5675 7834 5575 4985 7110 9511 8575 8598 5326 1618 12408 1493 622 554...

output:

11578 15580 1326 16152 5487 23443 5850 21061 14210 6290 15813 1287 14424 24825 12308 9063 23502 22254 6767 12392 16481 10603 10732 11019 21218 18274 1736 21126 20942 22849 22866 7256 3544 22749 18294 2844 22550 3260 16590 24546 22298 5960 7886 12370 15229 12335 24635 15673 15914 13003 11286 11411 14...

result:

ok ok, 5 yes, 0 no (5 test cases)

Test #50:

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

input:

10000
17
5 1 10 6 16 9 12 7 4 3 2 5 9 8 11 11 16 15 15 14 17 8 4 1 3 14 6 2 13 7 12 17 10 13
14 15
28 22
29 33
1 7
25 21
6 32
16 21
1 24
20 29
29 34
14 8
20 13
31 16
17 30
11 2
16 7
14 29
19 22
14 4
21 3
4 11
21 5
17 20
9 16
1 18
7 10
19 6
20 12
27 20
14 6
26 6
30 23
14 7
1
1 1
1 2
5
4 3 5 5 1 1 3 4...

output:

24 11 25 9 1 4 30 14 13 3 16 7 29 20 18 17 21 
2 
6 10 2 8 4 
27 32 30 6 44 63 7 51 69 5 11 61 38 16 23 45 54 50 36 53 47 55 58 17 31 24 39 43 52 34 40 14 59 49 67 
21 11 23 35 9 10 6 5 1 42 39 41 22 40 26 2 19 3 29 7 33 
3 8 7 1 5 4 
38 17 23 12 6 10 24 27 31 1 34 4 35 41 2 15 44 8 26 32 20 11 
1 8...

result:

ok ok, 9557 yes, 443 no (10000 test cases)

Test #51:

score: 0
Accepted
time: 53ms
memory: 13700kb

input:

100
759
540 409 524 558 373 187 390 477 385 545 618 455 512 199 390 562 536 26 589 46 440 43 604 457 61 186 90 16 744 202 575 415 60 28 80 13 18 370 302 238 217 218 202 506 84 109 264 519 401 203 613 656 707 677 487 180 572 614 277 351 23 459 78 730 184 588 618 608 594 728 658 160 481 671 556 335 51...

output:

554 876 843 145 704 1034 1402 1178 451 90 730 918 613 427 1203 28 959 346 1039 817 227 1314 210 1274 608 18 1191 34 1472 1196 929 259 980 552 1302 1435 529 521 837 393 1144 578 22 1025 1022 872 634 333 376 926 1433 1491 1008 1147 764 834 1187 251 1182 129 597 101 1293 83 615 406 1401 139 1183 921 11...

result:

ok ok, 89 yes, 11 no (100 test cases)

Test #52:

score: 0
Accepted
time: 133ms
memory: 36524kb

input:

1
100000
71806 81301 32390 661 95270 16473 468 97519 83833 97276 64701 99078 89566 25357 16868 68429 44826 79365 63160 98595 36138 79286 51037 58588 90447 97650 74 53296 34481 82439 23730 35222 41841 84801 72381 1361 83828 59655 98072 30016 97506 70859 55373 41115 63520 33284 83215 44750 66620 84316...

output:

91345 36101 39444 66233 155275 156515 158829 180874 170687 29752 15946 91399 55526 26111 40310 85851 155036 172860 134990 188340 114421 152287 27730 100325 43583 115334 179978 154323 184544 40288 191518 96828 19063 44512 168948 64067 1211 132228 86639 199118 33341 179790 192297 691 167922 95471 1880...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #53:

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

input:

10000
2
2 1 1 2
2 3
1 2
4 3
2
2 2 1 1
1 3
2 3
1 4
3
2 3 1 1 2 3
1 3
1 6
2 5
2 4
6 2
4
3 1 1 2 2 4 4 3
1 4
4 7
6 8
2 6
8 1
3 7
5 4
5
5 4 2 5 3 1 2 4 1 3
10 3
6 5
8 6
2 7
2 4
6 4
9 4
6 10
1 7
9
7 5 1 4 6 9 3 5 4 2 3 6 8 7 1 9 2 8
1 6
11 13
13 14
4 2
10 15
1 3
14 18
1 4
17 4
1 11
3 8
6 5
6 7
8 12
11 9
...

output:

3 4 
4 1 
4 5 2 
3 4 1 7 
6 3 10 2 4 
15 10 11 4 2 5 1 13 6 
-1
5 2 1 8 
2 5 4 
-1
8 3 4 5 6 
30 29 17 34 31 3 7 25 28 15 16 33 14 19 26 20 12 
12 7 11 3 14 5 15 4 
-1
-1
11 5 10 2 7 9 8 3 
30 18 35 36 9 8 29 25 1 21 7 15 28 24 26 12 20 17 37 
5 1 3 
5 3 8 9 6 12 14 
48 14 45 7 26 9 33 29 44 8 35 39...

result:

ok ok, 8621 yes, 1379 no (10000 test cases)

Test #54:

score: 0
Accepted
time: 55ms
memory: 11424kb

input:

100
528
145 489 238 115 240 73 43 274 88 378 452 334 20 45 302 501 201 377 485 409 71 297 385 136 410 196 245 157 77 182 500 439 67 122 447 374 306 47 247 160 233 414 453 416 189 203 316 379 299 394 343 507 258 487 484 227 375 354 278 164 402 450 191 125 193 109 188 4 49 301 220 211 521 83 405 95 26...

output:

-1
-1
175 297 211 277 348 483 97 118 673 472 567 187 813 267 387 42 825 400 818 135 30 173 438 474 318 599 708 3 6 14 142 736 200 69 228 88 236 675 598 458 94 816 392 768 195 738 703 427 340 233 910 304 164 92 166 876 91 848 272 940 177 134 481 523 123 232 638 654 338 528 923 115 511 695 265 623 978...

result:

ok ok, 47 yes, 53 no (100 test cases)

Test #55:

score: 0
Accepted
time: 143ms
memory: 37156kb

input:

1
100000
91100 66576 24016 35739 96752 62909 37176 43246 26877 80686 52627 73245 30468 14911 61239 8888 57068 15739 59836 74689 34070 35045 61075 76116 45821 89254 95765 79663 59158 90793 88461 69903 16552 35626 85369 45452 49290 96456 54439 75305 85230 36116 63563 27266 35985 55735 71420 81814 6196...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #56:

score: 0
Accepted
time: 40ms
memory: 7992kb

input:

10000
16
1 3 9 5 14 10 1 2 6 16 12 2 8 15 13 9 4 5 10 13 15 8 6 7 4 7 12 14 11 16 3 11
13 27
2 20
29 32
6 28
9 23
2 31
5 26
27 4
10 31
11 8
23 6
24 6
14 27
27 21
15 14
12 29
17 6
21 25
26 32
2 22
29 6
19 9
26 10
5 11
30 32
1 17
6 7
6 16
27 29
32 3
31 18
8
1 8 4 3 3 6 8 2 7 6 7 5 1 2 5 4
6 4
14 10
15...

output:

-1
13 14 4 16 15 6 11 2 
1 19 18 7 11 22 3 12 5 2 20 15 24 
4 11 7 3 2 13 6 
7 10 12 2 5 13 1 
2 
10 13 7 26 23 21 11 19 5 15 22 9 25 
4 5 6 3 17 19 20 18 15 10 
2 
-1
5 6 1 
-1
16 28 24 13 25 26 30 1 15 33 37 27 10 3 36 38 29 2 18 
9 15 8 6 13 11 4 2 
11 10 12 3 20 9 1 14 6 19 
3 9 1 6 4 11 14 
4 3...

result:

ok ok, 7728 yes, 2272 no (10000 test cases)

Test #57:

score: 0
Accepted
time: 48ms
memory: 10896kb

input:

100
124
79 2 39 58 26 117 87 83 65 19 19 11 6 106 74 38 18 54 73 1 124 115 89 113 42 99 59 44 46 42 84 50 104 23 27 34 90 66 4 88 16 26 58 1 55 92 15 73 96 118 29 40 98 48 121 94 8 23 114 68 6 105 122 91 15 45 98 113 33 37 66 9 53 91 9 48 35 49 22 7 18 22 12 71 69 108 88 111 67 107 44 123 10 47 80 1...

output:

-1
175 1561 147 1949 1512 484 1212 1788 401 1231 1365 340 1161 1478 663 1447 1753 15 1378 956 1436 558 438 476 1597 882 131 385 1045 1403 1838 544 863 2031 266 1727 1126 1444 657 392 1165 488 516 161 367 1338 1636 541 296 38 1677 1359 1566 1555 1363 1878 959 991 289 2022 1040 906 304 1674 1110 51 12...

result:

ok ok, 19 yes, 81 no (100 test cases)

Test #58:

score: 0
Accepted
time: 140ms
memory: 35960kb

input:

1
100000
87954 87628 66502 18246 94397 23451 12386 30973 72283 2422 68627 20250 75894 4463 89736 59504 87164 94289 10760 10803 75626 81488 63389 96763 85392 66695 28679 36243 55581 12303 2782 46089 37988 62949 10300 19238 78996 52142 44542 39311 42157 44359 86167 41807 19790 13789 7376 55549 85726 5...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #59:

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

input:

1000
71
28 31 10 39 22 34 54 4 50 27 23 20 46 2 4 28 38 45 42 2 62 37 43 18 47 61 1 40 6 14 23 69 26 70 17 5 13 64 10 42 9 61 41 15 48 70 18 12 63 36 35 29 1 52 66 44 19 60 26 68 15 65 55 50 32 55 8 24 56 16 62 22 57 21 29 51 48 59 31 49 44 53 57 67 71 7 46 25 66 53 36 68 35 58 59 64 34 21 8 45 30 3...

output:

-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
4 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
2 3 
-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...

result:

ok ok, 23 yes, 977 no (1000 test cases)

Test #60:

score: 0
Accepted
time: 118ms
memory: 48140kb

input:

1
100000
39058 71246 69524 5367 72560 48479 62002 31687 70026 90624 11410 82171 94463 95230 31776 30411 67216 11612 34847 40497 7880 40228 25003 17277 24209 967 2609 17998 59808 86924 10785 98255 75112 66199 54555 83386 767 8743 52120 14931 26083 66974 27082 24083 9100 16163 77573 94088 22745 15529 ...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #61:

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

input:

1000
86
10 59 60 19 66 12 56 73 38 69 57 71 32 23 85 52 59 38 7 16 86 64 36 66 31 81 28 27 62 26 15 74 17 28 65 39 6 27 80 14 5 3 78 51 76 81 74 29 75 50 20 9 58 8 42 25 5 73 57 40 58 18 8 41 54 82 47 48 21 61 54 44 37 2 50 7 84 78 47 11 18 55 67 46 22 6 32 16 49 14 79 44 1 64 45 4 82 41 25 71 19 11...

output:

169 126 155 96 41 86 19 54 52 1 102 106 129 90 31 88 33 81 4 152 69 172 132 157 56 153 28 27 125 147 25 87 162 170 122 23 73 9 138 60 64 150 104 72 95 131 67 68 143 75 44 113 107 65 82 158 11 53 2 144 130 29 105 22 35 5 83 165 160 134 12 141 58 32 49 45 120 78 164 39 46 66 159 116 15 21 
27 8 51 18 ...

result:

ok ok, 1000 yes, 0 no (1000 test cases)

Test #62:

score: 0
Accepted
time: 97ms
memory: 40064kb

input:

1
100000
89234 97708 51416 80782 8189 18848 43815 96245 52669 25341 2540 45715 88030 25858 41831 71283 5589 30574 3147 27445 62344 98200 1308 68253 4259 65970 99852 89754 45366 65217 2713 27137 56964 7288 95993 89547 27789 73960 18687 69892 66347 8941 35895 24825 31724 16617 88541 31732 94792 55881 ...

output:

75227 89390 117202 118736 56908 21751 93943 107106 96505 118014 22996 18916 195990 180647 161783 45067 116933 154132 175525 31033 131717 76697 86669 27780 36156 191597 111293 189802 75127 140032 116430 51914 165808 3183 139395 148722 100725 13420 22446 14080 55495 10131 106864 145825 140553 54364 37...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #63:

score: 0
Accepted
time: 41ms
memory: 9992kb

input:

1000
62
15 2 40 49 3 14 28 37 41 58 45 48 62 8 47 53 13 57 33 14 33 25 1 34 60 51 55 30 21 35 24 59 19 59 34 43 38 60 31 9 32 29 2 38 30 45 24 10 19 4 22 8 61 51 52 25 11 46 6 50 1 39 50 13 44 16 10 11 47 3 7 20 46 52 49 54 61 6 7 56 29 20 44 39 16 27 28 27 42 36 56 41 43 42 5 40 18 26 36 32 54 15 3...

output:

61 43 70 50 95 59 71 14 40 48 68 110 64 6 1 66 109 97 49 82 29 113 123 47 56 98 86 7 81 28 39 100 21 24 105 99 8 44 62 96 9 94 93 65 11 58 15 12 4 60 54 74 107 76 104 91 18 10 34 38 77 120 
34 9 2 26 28 37 38 3 21 36 17 40 20 15 42 24 16 33 43 29 18 22 
175 203 93 178 65 98 107 271 262 232 300 249 2...

result:

ok ok, 1000 yes, 0 no (1000 test cases)

Test #64:

score: 0
Accepted
time: 75ms
memory: 48552kb

input:

1
100000
50358 11364 23298 88192 27373 72806 41360 15760 32413 3563 96594 8549 8430 34234 92069 57195 93450 43827 84110 59936 88424 19133 8023 87926 67958 62380 86352 112 73769 18647 60190 79054 96766 18942 59856 10295 72508 45735 5793 14237 55731 20565 94839 50673 76695 8885 78236 342 27757 71828 5...

output:

145002 24465 91235 54445 81140 99617 91696 135296 106278 63462 102872 76834 147949 151278 168457 100340 163797 144016 159194 180167 139139 69947 193683 186469 103928 80539 155617 8572 53807 122894 44882 124432 194445 53686 43306 167252 121688 2827 197727 18355 110271 140636 99878 192120 45217 24744 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #65:

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

input:

1000
203
28 48 12 181 151 187 81 51 89 197 108 58 183 160 172 6 172 105 23 17 120 88 176 35 2 129 77 111 39 101 103 177 113 83 6 42 41 192 71 32 67 124 97 176 74 3 159 167 135 94 159 31 123 122 19 80 13 115 165 201 131 133 81 46 185 166 57 4 178 86 134 21 93 180 76 184 147 124 202 165 203 127 1 153 ...

output:

200 25 389 307 110 35 338 286 343 140 232 3 57 90 346 128 20 373 55 324 222 112 87 138 176 300 164 1 208 291 52 40 174 199 351 249 357 145 29 315 37 370 395 99 402 64 349 319 108 173 320 88 279 118 193 369 205 12 274 185 403 100 104 101 263 235 282 178 103 124 119 201 157 45 96 196 355 114 267 56 63...

result:

ok ok, 1000 yes, 0 no (1000 test cases)

Test #66:

score: 0
Accepted
time: 97ms
memory: 40120kb

input:

1
100000
42665 88983 29640 39217 71574 27580 67107 79774 82560 89042 68600 14045 74438 54115 38966 82210 8126 18690 51010 22007 27537 42904 216 82701 91122 25787 37167 82055 71416 3689 46699 53447 40468 5026 27371 55239 79258 54244 58 13679 19235 24852 323 94839 97860 27348 84163 89245 63050 77470 5...

output:

146758 38926 135502 28428 138824 192101 30090 31763 9807 85694 107899 127277 145291 50623 30988 140441 45536 139648 173545 71790 155641 54881 118621 32843 84542 183885 6608 11668 168224 1665 12930 160939 178060 53699 133627 73638 112555 48001 178432 167161 61157 121365 95936 92801 131157 102619 3397...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #67:

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

input:

1000
7
1 3 6 3 1 5 7 6 5 4 4 2 7 2
6 9
10 4
7 3
2 14
12 5
10 8
1 7
1 14
8 3
9 13
2 11
11 6
4 12
203
89 18 36 196 157 166 4 23 136 98 110 133 7 84 175 160 127 150 89 56 45 38 17 8 187 154 82 97 55 57 27 144 174 95 68 42 99 184 88 100 7 136 63 193 120 10 116 24 147 197 190 20 21 176 47 187 122 40 38 1...

output:

1 14 2 11 6 3 7 
402 193 116 7 386 268 13 24 171 390 141 71 201 149 233 107 23 147 277 52 196 229 126 48 176 351 374 396 105 84 346 220 127 403 112 321 82 22 261 121 375 353 395 81 21 256 55 67 188 241 173 150 230 344 29 20 30 202 251 290 195 203 243 302 284 257 331 68 186 324 94 326 349 263 301 320...

result:

ok ok, 1000 yes, 0 no (1000 test cases)

Test #68:

score: 0
Accepted
time: 100ms
memory: 39644kb

input:

1
100000
3533 69698 66793 74994 22094 91705 51112 96924 53179 46545 73172 66430 86669 65850 20438 2704 72851 23880 79835 47020 16399 71630 3602 88075 8421 75835 30404 72205 41060 31986 15645 25833 38129 3761 49422 5633 49490 71779 35060 66532 97531 11033 47700 17081 69812 22661 54313 14854 38350 253...

output:

114867 17811 118337 72706 57995 130976 59207 157400 77792 119015 79314 113312 89793 50832 171716 31071 176511 15765 36482 99225 112433 126308 152051 28815 195348 128025 166729 111763 180515 73812 61564 88471 157669 122371 187776 125782 63468 171989 184776 132577 141535 171404 141840 116549 161432 17...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #69:

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

input:

1000
84
17 1 39 70 64 69 27 35 62 37 67 65 58 34 30 63 54 68 83 68 29 73 45 24 24 23 77 4 59 70 2 1 57 25 78 31 55 71 59 81 7 33 58 84 57 16 66 61 50 76 6 38 62 47 5 83 82 26 52 8 11 20 78 42 49 16 40 23 19 36 22 75 38 51 75 60 80 22 50 43 30 64 32 55 39 13 14 49 15 63 65 82 12 17 44 43 41 67 14 28 ...

output:

32 31 140 28 55 51 166 60 161 156 61 138 86 87 106 46 94 118 69 62 114 78 26 24 34 58 7 100 116 15 160 83 121 133 125 70 112 52 85 67 124 141 80 123 23 152 136 129 65 79 137 59 117 17 84 134 45 13 29 126 168 53 16 5 12 108 98 20 6 4 38 101 22 109 75 139 27 63 132 77 40 57 19 145 
99 224 156 190 176 ...

result:

ok ok, 834 yes, 166 no (1000 test cases)

Test #70:

score: 0
Accepted
time: 89ms
memory: 40036kb

input:

1
100000
73794 58815 10576 49289 38320 66352 45372 75779 86264 54648 83434 55962 88697 26663 36022 33946 59325 47560 74571 87343 36114 61065 331 5660 96323 41348 34953 58432 62282 69245 30733 33060 78833 40428 19895 1779 16573 92521 64471 38737 36775 92976 61323 71528 71629 97665 70565 184 4323 2366...

output:

194012 172233 42721 101451 149208 102381 78685 83413 181450 99854 32201 625 102863 17311 160873 27340 148138 56754 141637 109832 153010 157335 66495 29961 162541 134345 65957 116704 79356 128039 41264 93813 61157 46697 76045 106684 188084 99233 51476 85973 54570 27053 168146 36188 74616 194650 43037...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #71:

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

input:

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

output:

-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
2 
-1
-1
35 10 8 60 87 64 24 6 3 80 27 92 48 5 21 47 43 16 89 49 33 84 105 101 30 39 54 55 37 74 9 11 79 63 73 7 23 70 28 20 68 52 100 59 75 67 22 42 99 19 86 58 76 
3 4 
-1
-1
-1
-1
-1
...

result:

ok ok, 67 yes, 933 no (1000 test cases)

Test #72:

score: 0
Accepted
time: 107ms
memory: 45608kb

input:

1
100000
94259 9796 35791 92962 61695 43746 26932 51081 46964 8284 54573 88140 46899 96789 94316 96739 27615 19153 60911 38388 80141 29278 94438 40088 39468 5243 14759 12289 14467 55805 31177 13190 20976 63063 75223 42057 44611 28095 62371 37663 90479 7858 33323 17764 214 75311 51714 97189 37733 953...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #73:

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

input:

1000
108
78 40 95 102 50 19 85 83 92 29 83 60 87 99 32 48 15 57 79 107 60 52 82 26 72 35 79 106 97 65 69 3 13 18 31 24 104 49 82 20 20 93 21 21 23 49 65 89 36 3 57 46 53 93 59 37 68 27 26 46 10 42 62 70 36 94 97 51 81 33 56 99 78 7 45 90 52 103 34 59 102 14 11 63 28 4 87 86 96 16 101 64 17 1 100 47 ...

output:

115 158 32 146 192 98 99 106 138 61 83 149 33 199 17 134 123 34 6 41 44 136 125 36 207 24 58 139 10 196 35 15 70 79 26 49 126 201 205 144 140 62 178 141 184 60 187 168 38 180 68 77 111 162 173 71 18 193 80 21 150 63 206 92 30 176 165 57 164 64 156 25 203 110 159 143 121 73 27 151 185 23 11 211 155 8...

result:

ok ok, 516 yes, 484 no (1000 test cases)

Test #74:

score: 0
Accepted
time: 123ms
memory: 47148kb

input:

1
100000
7142 53603 35836 1693 52053 52703 81806 40583 84170 54739 70937 3334 78777 43463 56945 44711 38949 36125 87642 35098 9271 53696 67074 89552 59161 61737 57235 93966 66507 14308 32525 10999 93976 62535 57087 38261 45626 70177 25471 50225 24971 19361 28539 52176 19674 78310 14242 82074 9325 78...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #75:

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

input:

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

output:

-1
-1
-1
-1
3 1 
-1
-1
-1
-1
-1
-1
-1
4 3 
-1
17 4 6 21 20 8 24 3 26 9 10 25 15 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
10 7 4 6 12 2 
-1
-1
-1
-1
124 115 131 29 46 60 77 38 15 129 117 42 91 143 154 68 130 144 113 100 75 107 108 147 84 67 142 146 8 10 43 106 135 141 61 99 12 33 85 17 122 34 56 88 110 121 ...

result:

ok ok, 307 yes, 693 no (1000 test cases)

Test #76:

score: 0
Accepted
time: 106ms
memory: 46996kb

input:

1
100000
87444 66115 41220 2901 65058 62471 81859 13497 81107 18463 21551 27647 62750 10057 67489 40954 73399 63729 8365 65206 673 61667 95334 75568 22246 8741 15971 64547 8597 68379 26834 47613 71543 16690 29679 45756 25052 79340 18977 81073 40723 47197 49284 80226 71333 53086 7970 2064 16130 21142...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #77:

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

input:

1000
114
59 92 50 19 22 31 45 81 99 88 85 47 97 16 49 27 36 10 26 102 96 10 56 78 68 65 109 32 47 94 76 55 77 17 103 61 83 11 36 59 86 43 64 114 41 87 113 104 74 70 1 79 70 76 27 8 58 110 21 39 35 80 86 107 14 111 44 100 99 45 51 14 89 42 112 56 85 64 84 32 60 9 57 23 111 108 55 3 34 38 26 57 75 17 ...

output:

-1
-1
-1
-1
1 2 5 
-1
4 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2 5 6 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
4 5 2 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3 1 
-1
-1
2 3 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3 2 
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok ok, 56 yes, 944 no (1000 test cases)

Test #78:

score: 0
Accepted
time: 109ms
memory: 47648kb

input:

1
100000
56589 92611 89298 32159 75729 4716 59714 40159 99197 61345 93144 76632 10339 94359 48464 63864 71635 39276 73168 55998 56180 15708 93262 93918 16821 40172 61139 28839 28731 54579 78100 98334 39342 46282 39052 19363 78007 35185 55764 2743 13840 17773 78394 66379 99324 62947 98887 19326 78176...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #79:

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

input:

1000
77
15 74 58 65 73 49 31 40 8 42 56 75 51 64 17 2 39 43 59 17 15 46 1 65 3 33 24 49 30 69 60 68 11 5 27 68 25 23 18 76 40 21 41 26 72 18 35 55 32 62 54 48 3 5 12 74 21 57 63 4 33 60 47 6 52 10 29 36 53 67 38 51 9 50 52 27 32 7 66 35 36 62 45 31 70 19 41 19 14 11 70 56 57 24 13 2 50 72 42 47 77 5...

output:

-1
-1
695 576 336 289 166 136 552 254 376 550 590 348 512 36 83 278 145 9 195 276 598 42 562 396 569 21 299 196 553 319 32 46 648 357 505 281 107 474 38 535 673 541 564 65 187 75 90 231 441 140 190 481 62 620 73 174 467 574 171 608 175 554 703 182 722 759 525 131 498 663 383 249 506 439 35 401 251 2...

result:

ok ok, 515 yes, 485 no (1000 test cases)

Test #80:

score: 0
Accepted
time: 87ms
memory: 40108kb

input:

1
100000
77913 78703 89244 88466 20878 12817 71616 65987 80894 23698 96344 63952 26160 81115 44502 79272 70654 12974 21619 23828 92092 5288 20605 76532 38229 46250 97974 34236 2215 83900 4983 41140 1412 16920 60214 16071 83793 81847 73816 18441 36699 80573 69718 25230 6190 80152 30641 28324 77464 22...

output:

185631 50625 193082 68496 54587 66756 49401 674 146634 33301 31253 27616 6501 90610 57318 183617 98760 180371 45102 163770 115046 98106 26599 33749 174614 117452 57350 27020 89829 38235 30202 120911 103572 9641 115378 292 24376 90939 173605 156700 155146 70938 121539 57035 24876 119110 138616 14194 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #81:

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

input:

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

output:

-1
-1
11 16 29 2 28 22 25 30 12 27 6 33 15 34 19 1 13 7 
4 3 1 
-1
193 65 383 257 126 379 8 328 279 67 265 274 76 311 165 6 114 166 139 378 350 55 172 337 155 156 72 61 271 87 202 20 284 192 353 96 138 108 195 366 171 71 183 230 204 198 116 352 11 185 297 150 291 288 316 2 113 15 107 238 301 213 290...

result:

ok ok, 288 yes, 712 no (1000 test cases)

Test #82:

score: 0
Accepted
time: 108ms
memory: 44144kb

input:

1
100000
4677 60875 1173 67932 70329 18974 98885 1958 29218 36525 77803 62221 1289 73242 51296 76557 29931 29164 92904 4881 34736 73728 10867 46179 24053 53232 54979 97063 91782 25304 24493 15236 5556 37554 42972 98559 33170 73501 81185 32215 13245 65707 53868 37504 8654 86550 73370 77408 39561 8997...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #83:

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

input:

1000
35
35 23 2 27 22 12 6 1 17 14 25 5 8 24 5 2 32 16 24 13 9 6 26 23 27 1 35 13 9 18 18 30 22 31 7 15 14 29 34 12 4 15 4 16 21 26 8 20 28 10 11 25 10 21 33 3 31 28 32 17 3 19 11 29 20 19 34 30 7 33
26 15
32 40
7 8
53 51
60 31
42 18
30 9
68 13
53 32
62 48
44 60
23 11
58 21
2 5
29 38
37 36
36 44
46 ...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
3 5 1 
-1
-1
-1
-1
3 1 
2 6 1 
-1
-1
3 4 
-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
3 6 1 4 
-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
...

result:

ok ok, 43 yes, 957 no (1000 test cases)

Test #84:

score: 0
Accepted
time: 120ms
memory: 40044kb

input:

1
100000
39803 80625 34985 89384 46739 87709 39497 28123 11229 36922 7389 10038 3436 16947 20497 89251 77357 59476 44802 96455 98379 90760 41298 58276 57851 89935 78693 40943 37523 89641 70667 79498 83338 21860 64438 4701 6541 56076 39658 24764 15656 76851 89550 10148 51648 18768 9795 91582 71163 26...

output:

-1

result:

ok ok, 0 yes, 1 no (1 test case)

Test #85:

score: 0
Accepted
time: 99ms
memory: 32952kb

input:

1
100000
45577 17555 72721 7730 90513 54320 43993 99602 37137 32109 62986 6219 22768 36143 41191 15855 70600 61797 83774 86054 40444 36698 15263 78313 16252 64027 57579 7209 21696 11479 33584 69737 30322 70615 53832 17979 97255 94902 67498 97040 9564 9356 79872 20031 44054 99063 73654 27520 13663 76...

output:

4055 4584 6580 93447 70744 173044 56827 158731 5578 7001 132725 169482 180610 45033 106512 62303 23410 60000 70049 33109 52875 60775 58313 147631 6224 182619 98313 94109 169822 138569 24340 231 179438 196514 151338 45501 179234 109009 78872 37407 165311 14861 11030 7263 198220 72092 61280 122368 334...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #86:

score: 0
Accepted
time: 96ms
memory: 34008kb

input:

1
100000
15252 72283 89243 49598 66102 3304 34985 81538 23529 32838 60693 98096 32999 19700 72769 20894 824 50215 2257 46741 10479 48350 86440 12631 93532 80539 76066 68387 87074 4053 28640 55716 26399 79467 72199 60718 40446 32826 90881 69105 83266 81876 6292 95079 71266 61012 31540 66882 99822 319...

output:

136085 16941 122786 21790 133185 102648 28718 69750 69099 64400 15760 86131 111824 64921 116350 199111 139821 51839 91292 64458 103712 149826 86415 177803 53525 5339 50227 83648 170753 99509 182183 141196 65693 85290 62715 29050 118916 71467 5795 36484 107886 67881 136179 136505 158071 155914 83463 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #87:

score: 0
Accepted
time: 72ms
memory: 34288kb

input:

1
100000
38692 11468 6952 98823 96156 76393 50277 94065 13165 65649 97899 87707 87241 2484 23980 48497 88047 56821 65710 12720 57991 34002 75866 22193 40530 50194 83387 16990 15789 40018 98723 15618 56911 14498 73522 33838 27744 51431 17531 31203 8592 29388 65930 13203 46920 72103 78331 29643 27465 ...

output:

139844 46764 154322 117515 137169 36735 19389 102443 126474 196688 60094 79911 183016 143901 188691 154969 62185 65742 76733 61843 51146 8707 153341 140696 3027 178599 62108 161296 155985 149534 123456 109621 184226 113833 92705 19716 36592 3860 109508 128279 39544 50971 38994 94881 116932 175716 76...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #88:

score: 0
Accepted
time: 74ms
memory: 34004kb

input:

1
100000
95457 72710 50284 3656 92162 90533 99476 41393 15366 77087 66221 98863 95530 54677 19575 58368 34677 60650 17642 79113 37819 78808 37204 38434 39443 86441 38051 29883 34491 1721 45619 23933 65672 98760 44739 48315 60295 33261 31436 68122 49314 43494 60503 9390 85955 99219 77446 78989 28385 ...

output:

154326 72783 96972 143322 163629 125895 117585 128391 148047 195753 10267 58492 109634 55199 198761 147451 186637 199695 175892 75732 7402 150234 11687 96503 89342 248 66127 113220 82976 82942 191331 151910 154791 136099 106313 10914 7386 163658 112894 81849 132324 53229 104785 171041 164293 164425 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #89:

score: 0
Accepted
time: 77ms
memory: 33932kb

input:

1
100000
76524 52479 81488 14746 19188 72143 37143 34254 33236 54058 92515 8715 79999 47606 27346 95765 9250 72703 99305 63965 98050 56375 71824 61244 43021 20579 73568 91012 11900 86610 76940 29490 77353 5933 469 35961 16482 15280 31259 54298 93756 23618 60521 21057 31594 59757 83693 72303 48458 81...

output:

104855 29243 109651 107510 112842 14655 147778 136388 23042 90944 20673 49141 54782 137101 1949 191625 192096 187234 96315 37777 187427 31282 183875 136342 192684 188612 63044 189631 89503 107577 102032 145602 146882 192252 22807 119640 141513 101328 109374 186056 181794 120972 90258 147347 96097 15...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #90:

score: 0
Accepted
time: 67ms
memory: 33668kb

input:

1
100000
83660 56016 82052 48153 23943 27412 82128 98126 71746 25878 58429 57914 77037 99257 46966 30114 91694 39381 22828 26997 65274 4378 37000 49364 43697 14372 11806 26559 44073 14554 99300 31101 73895 33621 24571 21250 38984 34984 57816 19791 43302 19988 83113 51975 76084 95490 66391 51934 9757...

output:

103279 105746 84939 84376 191987 165191 172503 96729 155491 50436 128676 134526 159645 174044 5744 27403 69337 153908 170821 155264 63065 189810 48698 15463 129290 170139 10073 170001 131552 112261 26388 173740 14069 180555 97868 177646 20658 162898 28364 30125 88283 35110 118022 9292 194106 124182 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Test #91:

score: 0
Accepted
time: 58ms
memory: 33916kb

input:

1
100000
18159 5004 40911 46931 34536 23213 12871 61305 51697 71027 25536 97640 34330 88880 33354 6731 57420 80783 75599 57752 11821 12476 35998 23762 52552 81471 97437 11375 81127 5127 8056 50657 48212 6916 93672 6415 91264 20675 5166 84884 26987 85700 45026 9284 27235 13507 31597 15642 39709 58883...

output:

121901 141520 99098 172726 56390 117721 152363 165983 84904 87749 123123 174711 142953 109093 98091 152966 22486 150275 180032 176766 186819 165638 195119 152534 137615 110451 197307 128438 104760 143065 100455 167149 134923 175498 143758 182595 187831 79848 190249 82966 118892 107063 198539 141969 ...

result:

ok ok, 1 yes, 0 no (1 test case)

Extra Test:

score: 0
Extra Test Passed