QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#303077#7798. Colorful VillagePhantomThreshold#AC ✓270ms96596kbC++202.4kb2024-01-11 17:42:202024-01-11 17:42:20

Judging History

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

  • [2024-01-11 17:42:20]
  • 评测
  • 测评结果:AC
  • 用时:270ms
  • 内存:96596kb
  • [2024-01-11 17:42:20]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
using namespace std;

const int maxn = 410000;

int n,rt,mk;
vector<int>col[maxn];
vector< pair<int,int> >E[maxn];

int siz[maxn],son[maxn];
void dfs(const int x,const int fa)
{
	siz[x]=1; son[x]=0;
	for(auto [y,i]:E[x]) if(y!=fa)
	{
		dfs(y,x);
		siz[x]+=siz[y];
		if(siz[son[x]]<siz[y]) son[x]=y;
	}
}

vector<int>V[maxn];
//x'  x
void dfs2(const int x,const int fa)
{
	for(auto [y,i]:E[x]) if(y!=fa && i!=mk)
	{
		V[x].emplace_back(y);
		V[y+n].emplace_back(x+n);
		dfs2(y,x);
	}
}
int dfi,dfn[maxn],low[maxn],cnt,bel[maxn],insta[maxn];
int t[maxn],tp;
void tarjan(const int x)
{
	dfn[x]=low[x]=++dfi;
	t[++tp]=x;
	insta[x]=1;
	for(auto y:V[x])
	{
		if(!dfn[y])
		{
			tarjan(y);
			low[x]=min(low[x],low[y]);
		}
		else if(insta[y]) low[x]=min(low[x],dfn[y]);
	}
	if(low[x]==dfn[x])
	{
		++cnt;
		int la=0;
		while(la!=x)
		{
			insta[la=t[tp--]]=0;
			bel[la]=cnt;
		}
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int Tcase; cin>>Tcase;
	while(Tcase--)
	{
		cin>>n; n<<=1;
		for(int i=1;i<=n+1;i++)
		{
			vector< pair<int,int> >_;
			E[i].swap(_);
			vector<int>c_;
			col[i].swap(c_);
		}
		for(int i=1;i<=n;i++)
		{
			int cc;cin>>cc;
			col[cc].push_back(i);
		}
		for(int i=1;i<n;i++)
		{
			int x,y;cin>>x>>y;
			E[x].emplace_back(y,i);
			E[y].emplace_back(x,i);
		}
		
		dfs(1,0);
		rt=1; mk=0;
		while( siz[son[rt]]*2>n ) rt=son[rt];
		if(siz[son[rt]]*2==n)
		{
			for(auto [y,i]:E[rt]) if(y==son[rt])
			{
				mk=i;
				break;
			}
			n++;
			E[n].emplace_back(rt,n);
			E[n].emplace_back(son[rt],n+1);
			rt=n;
		}
		
		for(int i=1;i<=n*2;i++)
		{
			vector<int>_;
			V[i].swap(_);
			dfn[i]=low[i]=bel[i]=0;
			insta[i]=0;
		}
		cnt=dfi=tp=0;
		dfs2(rt,0);
		for(int i=1;i<=n/2;i++)
		{
			int x=col[i][0],y=col[i][1];
			V[x].emplace_back(y+n);
			V[x+n].emplace_back(y);
			V[y].emplace_back(x+n);
			V[y+n].emplace_back(x);
		}
		for(int i=1;i<=n*2;i++) if(!dfn[i])
			tarjan(i);
		
		int ok=1;
		vector<int>ans;
		for(int i=1;i<=n;i++)
		{
			int x=i,y=n+i;
			if(bel[x]>bel[y])
			{
				if(i!=rt || n%2==0)
					ans.push_back(i);
			}
			if(bel[x]==bel[y]) ok=0;
		}
		if(ok)
		{
			for(int i=0;i<n/2;i++) cout<<ans[i]<<" \n"[i==n/2-1];
		}
		else cout<<"-1\n";
	}
	
	return 0;
}

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

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 41668kb

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:

2 3 5 7
-1

result:

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

Test #2:

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

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: 0ms
memory: 41964kb

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

result:

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

Test #4:

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

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:

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

result:

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

Test #5:

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

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
2 3 7 9 11 12 13 14
1 3 6
-1
2
2 5 6 8
1 3 5 6 9 10 11 14 16 19 20 22 24 27
4 5 6 7 8 9 11 16
-1
2 4 5 8 10 11 12 13 14 16 17 20 24 26 28 30 31 35 38 39
-1
2
1 2 3 4 7 9 13 15 17 19
2 5 6
-1
-1
-1
2
2
2 3 5 7 9 10 11 15
1 2 5 6
2 4
2
2
-1
-1
1 2 4 5 9
3 5 6
4 7 8 9 10 11
2 4 5
-1
3 4
3 ...

result:

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

Test #6:

score: 0
Accepted
time: 11ms
memory: 43156kb

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
1 2 5
1 2 5 8 9 10 11 16 17 19 23 25 27 28
2 4
-1
2
-1
2 3 4 5 6 10 11 15 17 19
-1
2 3 4 5
4 5 8 9 11 13 14 17 20 21 22
-1
1 3 4 7
2 3 4 7
-1
3 4 5 7
2 4
1 3 8 9 10 11 12 14 15 18 19 23 24 27 30
3 6 7 8 9 11 12 13 14 16 21 23 25
2 4 6 9 11 12
1 2 4 10 11 12
-1
-1
2 4 5 7
2
2
5 6 7 8
-1
-1
2 5 ...

result:

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

Test #7:

score: 0
Accepted
time: 57ms
memory: 43164kb

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
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: 74ms
memory: 42160kb

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:

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

result:

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

Test #9:

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

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

result:

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

Test #10:

score: 0
Accepted
time: 85ms
memory: 44960kb

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: 121ms
memory: 49056kb

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: 140ms
memory: 59080kb

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: 172ms
memory: 63724kb

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: 192ms
memory: 75228kb

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: 7ms
memory: 43152kb

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

result:

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

Test #16:

score: 0
Accepted
time: 7ms
memory: 43388kb

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:

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

result:

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

Test #17:

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

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:

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

result:

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

Test #18:

score: 0
Accepted
time: 9ms
memory: 43004kb

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:

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

result:

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

Test #19:

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

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:

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

result:

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

Test #20:

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

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:

3 5 7 9 12 14 16 18 19 20 23 25 33 35 36 38 39 41 43 49 50 52 54 55 62 63 66 73 74 75 76 77 78 80 81 83 85 86 88 89 91 92 96 101 102 103 104 107 109 111 112 113 115 120 121 122 124 125 127 129 131 133 134 137 138 139 141 143 144 147 152 154 155 156 158 160 161 162 163 166 167 169 170 172 173 174 175...

result:

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

Test #21:

score: 0
Accepted
time: 85ms
memory: 43180kb

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:

2 3 6 7 11 16 17 20 21 25 26 27 28 29 30 31 34 36 38 42 43 44 48 50 51 52 53 56 57 62 64 66 68 70 71 73 76 77 78 81 87 88 89 90 91 92 94 95 98 100 103 104 105 106 107 109 110 112 113 114 116 118 119 121 122 124 125 126 127 128 130 131 132 138 139 140 141 142 145 147 149 150 151 153 155 157 158 161 1...

result:

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

Test #22:

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

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:

1 2 3 4 5 6 10 11 12 13 16 18 19 23 24 25 27 28 29 31 32 34 38 40 41 42 43 44 45 46 48 50 54 56 59 61 64 66 67 68 69 71 74 75 76 78 79 80 81 82 83 86 89 93 95 96 103 105 106 108 109 110 111 112 114 116 117 118 119 120 122 123 124 127 129 130 131 132 133 134 135 136 137 138 145 149 152 154 155 156 15...

result:

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

Test #23:

score: 0
Accepted
time: 135ms
memory: 56416kb

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:

2 3 7 8 10 12 13 14 15 16 20 23 24 25 26 28 29 30 31 35 38 40 41 43 44 45 46 48 49 50 51 52 53 56 60 61 64 71 72 74 75 80 88 90 92 93 94 96 98 99 100 102 103 104 107 111 114 115 116 121 124 125 127 128 130 132 135 137 140 141 145 149 151 158 163 164 166 167 170 171 173 176 177 179 185 188 190 193 19...

result:

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

Test #24:

score: 0
Accepted
time: 165ms
memory: 58484kb

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:

2 5 7 8 11 12 14 15 17 18 22 24 25 28 29 32 33 34 38 41 43 45 46 48 49 51 52 53 54 55 56 61 62 63 64 67 68 70 74 75 81 82 85 86 87 89 90 93 95 99 100 101 102 103 105 106 110 112 115 117 118 124 125 126 130 132 135 136 138 139 141 142 144 145 146 147 152 153 156 158 159 160 161 164 165 169 170 171 17...

result:

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

Test #25:

score: 0
Accepted
time: 220ms
memory: 68564kb

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:

1 6 8 9 13 15 16 18 19 20 22 24 25 26 29 31 32 37 38 39 41 42 44 45 48 51 52 53 55 57 59 61 64 65 66 67 68 70 71 73 74 76 80 83 85 88 92 94 95 96 97 100 102 103 104 106 111 112 113 115 116 118 119 122 123 125 126 127 130 131 133 134 135 137 140 141 143 144 146 147 149 151 154 155 156 160 163 165 166...

result:

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

Test #26:

score: 0
Accepted
time: 65ms
memory: 41556kb

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:

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

result:

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

Test #27:

score: 0
Accepted
time: 65ms
memory: 41916kb

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

result:

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

Test #28:

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

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:

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

result:

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

Test #29:

score: 0
Accepted
time: 61ms
memory: 42984kb

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:

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

result:

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

Test #30:

score: 0
Accepted
time: 172ms
memory: 66956kb

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:

14 15 17 18 23 24 25 31 33 37 43 44 45 46 47 48 51 55 58 64 65 66 71 74 75 79 80 83 85 86 90 91 93 94 95 96 98 99 103 104 105 108 110 113 114 115 117 118 119 120 122 123 124 126 128 129 130 131 132 133 134 138 139 140 142 144 146 147 148 149 150 153 154 157 160 161 162 163 164 166 167 168 171 173 17...

result:

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

Test #31:

score: 0
Accepted
time: 212ms
memory: 68520kb

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:

3 4 5 12 19 23 24 25 27 28 32 34 43 44 46 47 48 49 55 56 58 59 60 61 62 63 66 68 70 72 73 76 79 80 86 88 89 90 93 94 96 99 100 101 104 106 108 109 113 115 116 117 118 119 120 121 122 127 131 132 133 135 136 140 141 146 149 152 153 154 156 158 164 166 167 168 173 174 176 177 179 184 186 188 196 200 2...

result:

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

Test #32:

score: 0
Accepted
time: 201ms
memory: 69940kb

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:

4 6 15 21 24 27 28 31 32 33 35 37 38 39 41 42 43 44 46 49 50 51 56 59 60 61 63 64 68 71 73 75 77 78 79 82 86 91 92 94 95 96 97 98 99 100 101 102 104 107 111 112 113 114 116 118 119 123 125 126 127 129 130 139 140 141 143 145 146 148 149 152 154 156 158 163 164 166 168 171 173 174 175 178 180 183 184...

result:

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

Test #33:

score: 0
Accepted
time: 197ms
memory: 70776kb

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:

3 4 6 7 9 10 13 16 17 20 22 24 25 27 28 29 32 34 36 37 42 46 48 49 51 52 53 54 56 57 61 63 64 65 66 68 71 72 74 75 76 78 79 81 82 83 86 88 95 96 97 98 102 103 105 106 111 112 113 118 122 125 126 130 132 133 139 140 141 142 143 146 147 150 151 152 153 156 157 160 161 163 164 165 166 167 171 173 174 1...

result:

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

Test #34:

score: 0
Accepted
time: 223ms
memory: 70916kb

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:

6 8 9 12 14 15 16 21 23 24 25 26 29 30 31 34 35 37 38 39 40 41 42 43 44 45 48 50 51 52 53 56 58 59 60 61 63 70 72 73 74 75 76 77 80 83 84 85 86 87 88 89 90 91 92 94 95 99 100 106 107 108 109 111 114 115 116 117 118 119 121 122 123 126 127 128 129 130 133 134 136 137 140 143 144 146 147 148 150 152 1...

result:

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

Test #35:

score: 0
Accepted
time: 198ms
memory: 69936kb

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:

8 9 10 11 12 15 19 20 21 25 26 27 28 32 33 35 37 40 42 43 44 47 51 52 54 55 58 61 62 63 64 70 71 74 76 78 82 83 85 88 89 93 94 95 96 98 99 101 103 105 109 112 114 115 116 119 124 127 130 132 133 134 135 137 141 142 144 145 147 148 151 155 156 157 158 159 160 161 163 164 166 167 168 169 170 171 174 1...

result:

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

Test #36:

score: 0
Accepted
time: 270ms
memory: 71720kb

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:

4 6 9 10 11 12 17 18 20 21 22 24 25 29 30 32 33 34 37 39 40 44 45 47 48 49 51 52 53 54 55 56 58 60 61 66 67 70 71 74 76 78 79 82 83 85 86 89 90 91 93 94 99 102 107 110 111 113 116 118 121 122 123 125 127 129 131 135 136 137 138 139 142 143 148 150 155 156 157 159 160 161 164 165 166 167 169 171 174 ...

result:

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

Test #37:

score: 0
Accepted
time: 235ms
memory: 74368kb

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:

3 5 6 9 11 12 14 15 17 18 19 20 25 27 28 29 30 31 33 35 37 39 40 44 46 48 55 57 59 60 61 62 63 65 66 67 69 70 71 73 74 75 78 79 83 84 85 86 88 89 90 92 94 95 101 102 103 104 106 109 113 117 120 123 124 125 126 127 132 133 134 135 136 142 144 147 148 149 151 152 153 154 156 157 159 162 163 165 166 16...

result:

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

Test #38:

score: 0
Accepted
time: 228ms
memory: 74396kb

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:

3 5 6 7 11 12 13 14 16 17 18 19 20 21 24 26 27 28 31 32 33 35 39 40 41 44 46 48 52 53 56 59 63 64 66 69 70 72 74 76 77 80 81 85 87 88 90 92 93 96 100 101 102 103 104 106 107 108 109 110 112 114 118 120 122 124 127 130 135 137 138 140 143 144 146 147 150 151 152 154 155 157 158 159 161 163 164 165 16...

result:

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

Test #39:

score: 0
Accepted
time: 214ms
memory: 75968kb

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:

5 6 7 11 15 16 18 20 21 22 25 26 28 31 32 33 34 39 41 45 46 48 50 53 54 55 56 57 59 60 63 66 71 72 73 74 75 77 79 80 81 83 84 90 92 94 95 99 100 102 103 104 110 111 115 116 118 123 124 128 131 133 135 136 137 140 142 143 144 145 146 147 150 153 154 155 161 162 164 165 166 168 169 170 171 172 173 175...

result:

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

Test #40:

score: 0
Accepted
time: 246ms
memory: 81128kb

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:

6 8 9 10 13 14 17 18 19 20 21 22 23 24 25 26 27 29 31 33 36 38 39 41 42 44 45 46 47 49 51 52 53 55 56 57 58 59 60 62 65 67 68 69 72 75 78 79 80 86 88 91 95 96 99 101 102 103 104 105 107 109 110 111 113 114 120 122 123 124 125 127 128 130 134 135 136 138 139 141 144 152 154 155 156 157 158 159 160 16...

result:

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

Test #41:

score: 0
Accepted
time: 227ms
memory: 80744kb

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:

4 5 6 11 12 17 20 21 22 23 24 25 27 28 29 30 31 32 33 34 36 37 38 39 40 41 42 44 45 46 48 49 51 53 54 55 56 57 58 59 61 62 63 64 65 68 71 74 76 77 79 80 83 87 88 89 90 95 96 99 102 103 105 107 108 109 112 115 117 120 122 123 124 125 126 127 130 132 135 136 143 144 146 148 149 151 152 154 155 159 160...

result:

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

Test #42:

score: 0
Accepted
time: 214ms
memory: 84288kb

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:

1 4 5 7 8 10 11 13 15 18 19 20 25 30 32 33 34 36 39 40 41 42 43 44 45 46 47 48 53 55 57 58 60 62 64 65 72 76 79 81 82 83 86 87 88 89 90 91 94 97 100 103 106 107 108 111 112 114 115 118 119 120 123 124 126 127 130 131 132 138 142 143 144 149 150 151 152 156 157 159 160 165 168 170 171 172 173 176 177...

result:

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

Test #43:

score: 0
Accepted
time: 65ms
memory: 42072kb

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

result:

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

Test #44:

score: 0
Accepted
time: 76ms
memory: 42104kb

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:

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

result:

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

Test #45:

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

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:

2 5 7 8 11 12 15 16 17
3 5 6 7
2 3 5 6 8 9 11 13 16 17 21 22 23 29 30 32 36 38 40 41 42
1 3 5 8 10 12 13 14 16 19 21 24 28 29 30 31 32 33 35 36 37 39 40 42 43 45 47 48 49 53 54 55 56 58 61 62 64 66 69 71 72 76 77 78 81 82 84 87 88 91 93 95 96 98 99 103 105 107 108 111 113 116 117 120 123 124 125 126...

result:

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

Test #46:

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

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:

13 14 15 16 19 21 22 27 28 30 35 36 37 38 39 40 41 44 45 46 48 49 51 53 54 56 57 58 59 60 62 65 67 68 70 73 74 75 78 79 81 82 83 84 85 86 87 89 90 92 94 95 98 100 102 104 105 106 107 108 110 112 113 114 118 119 122 123 125 127 129 131 132 133 135 136 142 145 148 150 151 152 153 155 156 157 159 160 1...

result:

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

Test #47:

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

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:

2 3 6 10 11 12 13 14 16 17 19 20 23 25 26 27 29 30 32 33 35 37 39 41 43 44 47 54 57 58 59 62 63 66 67 69 75 79 80 83 84 86 90 91 92 93 100 107 108 113 117 118 119 121 123 124 125 126 127 130 132 133 136 141 144 147 148 149 150 151 153 154 156 158 159 162 165 166 168 169 172 173 175 181 184 185 187 1...

result:

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

Test #48:

score: 0
Accepted
time: 124ms
memory: 47484kb

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:

2 3 5 7 10 12 13 16 20 24 25 26 28 30 32 33 34 36 37 38 41 44 47 50 53 54 57 59 60 62 65 66 70 71 72 75 77 78 79 80 81 87 91 92 93 97 98 99 101 102 105 107 114 117 118 119 121 122 124 126 127 129 130 131 134 135 137 141 144 146 147 149 152 153 155 156 157 161 163 164 165 166 167 168 171 176 178 179 ...

result:

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

Test #49:

score: 0
Accepted
time: 151ms
memory: 53956kb

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:

6 7 11 15 16 19 20 21 22 26 27 31 34 39 41 44 46 50 52 53 54 55 56 57 59 60 61 64 67 68 69 70 71 76 79 81 83 84 85 86 87 88 89 90 91 93 94 96 97 98 99 100 102 103 107 108 113 114 120 121 122 123 129 131 132 133 134 135 137 142 143 146 147 148 149 150 151 155 156 160 161 163 165 167 169 172 173 174 1...

result:

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

Test #50:

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

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:

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

result:

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

Test #51:

score: 0
Accepted
time: 91ms
memory: 44268kb

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:

3 8 15 18 20 21 22 28 30 32 34 35 36 38 39 40 42 44 46 47 49 50 51 52 54 60 63 67 68 69 72 74 75 76 79 83 85 87 88 90 92 98 100 101 102 103 104 105 106 108 109 110 112 114 116 119 122 123 124 127 129 130 131 133 134 136 139 142 143 144 145 149 150 151 154 155 159 160 161 163 164 165 166 168 169 175 ...

result:

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

Test #52:

score: 0
Accepted
time: 219ms
memory: 69428kb

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:

1 4 6 8 9 10 14 16 17 18 19 21 25 27 28 30 32 33 35 36 37 39 40 41 43 48 50 51 52 55 59 60 62 63 65 66 67 71 75 77 78 79 80 83 88 90 92 93 94 95 97 100 101 103 109 117 119 120 121 123 126 130 131 132 133 134 135 136 138 140 143 145 146 147 148 150 153 155 157 159 160 162 163 165 166 167 169 170 171 ...

result:

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

Test #53:

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

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
2 3
2 4 5
1 3 4 7
3 4 6 8 10
1 3 4 6 8 11 12 13 17
-1
1 2 5 8
2 4 5
-1
4 5 6 8 10
3 7 9 10 14 15 16 17 19 20 25 26 28 29 30 33 34
3 4 5 7 10 11 12 15
-1
-1
3 5 7 8 9 10 11 12
1 7 8 9 12 15 17 18 20 21 23 24 25 28 29 30 35 36 37
1 4 5
5 6 8 9 10 12 14
2 4 5 6 7 8 9 14 15 16 17 20 25 30 33 35 37 3...

result:

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

Test #54:

score: 0
Accepted
time: 86ms
memory: 44612kb

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
2 3 4 6 9 13 14 16 17 19 21 24 27 28 29 30 33 34 37 38 40 43 46 49 50 56 57 61 63 65 67 69 70 72 73 74 75 76 78 80 81 83 85 86 87 88 90 91 92 94 95 97 98 100 103 105 109 111 113 114 115 116 118 119 123 127 133 134 135 140 142 143 147 149 152 153 157 159 162 163 164 165 166 168 169 173 174 175 ...

result:

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

Test #55:

score: 0
Accepted
time: 191ms
memory: 73164kb

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: 73ms
memory: 43496kb

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
4 6 7 8 11 13 15 16
1 2 3 5 7 9 11 12 15 17 19 21 23
2 3 4 6 7 11 13
2 3 7 8 10 11 13
2
5 7 9 10 11 13 15 19 21 22 23 25 26
3 4 5 6 10 15 17 18 19 20
2
-1
2 3 4
-1
3 5 6 10 13 14 15 16 18 20 23 25 26 28 29 34 36 37 38
2 4 6 7 8 11 13 15
1 3 6 9 10 11 12 14 15 19
3 4 6 9 11 13 14
3 4
2 4
-1
2 3 4 ...

result:

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

Test #57:

score: 0
Accepted
time: 79ms
memory: 43808kb

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
5 9 11 12 13 14 15 16 18 24 30 31 33 34 36 37 38 40 41 43 47 49 50 51 55 61 67 76 78 79 81 83 86 87 89 92 93 94 95 96 97 98 99 100 101 105 106 116 120 121 124 125 126 131 132 135 137 140 141 144 145 146 147 149 151 153 154 156 157 158 159 160 161 166 167 171 172 175 176 178 179 181 184 187 188 19...

result:

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

Test #58:

score: 0
Accepted
time: 203ms
memory: 71280kb

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: 74ms
memory: 42420kb

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
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
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: 170ms
memory: 81092kb

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: 74ms
memory: 43048kb

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:

5 6 7 12 13 14 15 16 17 18 20 21 22 29 30 32 34 35 36 37 38 39 40 42 45 46 48 49 50 51 55 57 58 59 61 62 63 66 71 74 76 78 79 80 83 84 85 89 92 93 98 99 101 103 105 109 111 112 114 115 116 120 123 124 128 130 133 134 135 136 140 141 144 145 146 154 159 160 161 163 164 165 166 167 168 171
2 4 6 9 12 ...

result:

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

Test #62:

score: 0
Accepted
time: 206ms
memory: 70832kb

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:

4 6 10 12 13 14 19 20 21 22 27 28 29 32 33 34 38 40 41 42 43 44 46 47 49 50 51 54 56 59 61 66 70 72 73 77 78 79 81 82 83 84 85 86 87 89 90 97 99 101 102 105 106 109 110 111 113 117 119 120 122 123 124 125 126 128 129 131 132 133 143 146 147 150 151 152 153 156 158 159 163 164 165 167 168 172 174 175...

result:

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

Test #63:

score: 0
Accepted
time: 76ms
memory: 42600kb

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:

2 3 5 13 16 17 19 20 22 23 25 26 27 30 31 32 33 35 36 37 41 42 45 46 51 52 53 55 57 63 67 69 72 73 75 78 79 80 83 84 85 87 88 89 90 92 101 102 103 106 108 111 112 114 115 116 117 118 119 121 122 124
2 3 9 15 16 17 18 20 21 22 24 26 28 29 33 34 36 37 38 40 42 43
2 3 4 5 6 7 8 9 10 11 14 15 17 20 23 2...

result:

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

Test #64:

score: 0
Accepted
time: 220ms
memory: 81320kb

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:

4 5 7 13 16 20 21 22 23 24 29 30 35 42 46 50 51 52 53 54 57 58 59 61 62 63 64 65 66 67 71 72 75 76 78 79 83 86 88 89 90 92 93 104 105 106 108 112 113 114 115 117 118 121 122 123 126 129 130 131 134 135 137 138 139 140 141 143 146 147 152 155 156 157 158 159 160 161 164 166 169 171 172 173 174 176 17...

result:

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

Test #65:

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

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:

2 4 5 6 7 8 10 13 15 16 19 22 23 24 26 27 28 30 31 34 36 39 41 46 47 54 58 60 62 65 67 68 69 71 72 75 78 79 80 81 82 83 85 86 89 91 93 94 97 98 105 106 111 113 116 120 122 123 125 126 127 129 130 133 135 136 137 139 141 142 143 146 147 149 150 152 154 155 158 159 160 163 166 168 169 170 171 172 175 ...

result:

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

Test #66:

score: 0
Accepted
time: 221ms
memory: 80680kb

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:

2 3 5 7 11 12 13 16 17 19 20 21 22 23 25 27 29 30 34 36 37 41 44 45 46 47 53 54 56 57 58 59 61 64 67 69 71 72 74 75 76 77 79 81 85 91 92 94 96 97 99 105 106 107 108 109 110 112 113 114 115 116 117 119 120 122 125 126 127 132 134 135 137 138 148 149 153 155 157 158 159 161 166 167 169 172 173 176 179...

result:

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

Test #67:

score: 0
Accepted
time: 66ms
memory: 42700kb

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 2 3 6 7 11 14
4 5 9 11 14 17 19 20 21 22 28 29 30 33 37 38 39 40 41 46 47 48 49 50 51 52 54 55 56 57 60 61 62 64 67 68 74 78 81 82 83 84 85 86 87 91 92 94 95 96 105 111 112 113 115 121 122 123 124 125 126 127 130 131 135 137 138 139 140 142 144 145 146 147 150 151 153 154 156 159 163 167 172 173 1...

result:

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

Test #68:

score: 0
Accepted
time: 236ms
memory: 72624kb

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:

2 3 4 7 9 10 11 16 17 18 19 21 22 23 25 26 30 38 39 42 43 46 47 48 49 50 51 55 58 59 61 62 64 65 69 72 73 76 77 79 83 84 85 87 89 90 91 93 94 97 98 99 101 103 104 106 107 110 111 113 116 118 119 120 121 125 130 131 134 135 136 141 143 147 148 149 150 151 154 158 159 160 163 165 166 169 171 173 174 1...

result:

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

Test #69:

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

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:

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

result:

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

Test #70:

score: 0
Accepted
time: 213ms
memory: 74936kb

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:

1 3 5 7 8 9 13 14 17 19 21 22 23 25 27 30 34 36 38 39 41 47 52 53 54 55 58 59 64 69 70 71 72 73 86 87 88 89 90 91 92 94 97 99 100 101 104 107 108 109 110 111 114 121 123 124 125 127 128 129 131 133 135 137 141 142 143 145 146 147 150 153 154 157 158 159 160 161 163 164 165 166 167 169 171 172 173 17...

result:

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

Test #71:

score: 0
Accepted
time: 69ms
memory: 42676kb

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

result:

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

Test #72:

score: 0
Accepted
time: 209ms
memory: 84784kb

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: 70ms
memory: 43788kb

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:

6 9 10 11 14 15 17 18 21 23 24 25 26 27 28 29 30 32 33 34 35 36 37 38 41 44 49 54 57 58 60 61 62 63 64 66 68 70 71 73 77 78 79 80 81 83 87 88 92 98 99 104 106 110 111 115 121 123 125 126 130 134 136 138 139 140 141 143 144 146 149 150 151 155 156 158 159 161 162 164 165 168 170 172 173 175 176 178 1...

result:

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

Test #74:

score: 0
Accepted
time: 205ms
memory: 96244kb

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: 65ms
memory: 42808kb

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
2 4
-1
-1
-1
-1
-1
-1
-1
3 4
-1
3 4 6 8 9 10 15 17 20 21 24 25 26
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2 4 6 7 10 12
-1
-1
-1
-1
2 3 4 5 6 7 9 13 14 18 19 20 22 23 24 27 31 32 35 36 39 41 45 48 50 51 52 55 57 59 62 64 65 66 69 72 76 78 79 81 82 87 89 92 93 94 96 97 98 102 103 104 111 112 114...

result:

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

Test #76:

score: 0
Accepted
time: 191ms
memory: 96596kb

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: 71ms
memory: 43096kb

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

result:

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

Test #78:

score: 0
Accepted
time: 189ms
memory: 95904kb

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: 66ms
memory: 43344kb

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
3 9 12 13 14 16 21 22 24 29 32 33 35 36 38 41 42 45 46 47 51 52 54 57 62 63 64 65 66 73 74 75 77 78 79 80 83 84 86 87 89 90 93 96 99 102 107 108 113 114 117 122 123 128 129 131 133 134 136 137 138 140 142 143 145 147 148 149 150 151 152 153 154 155 157 158 159 160 165 166 167 168 170 171 174 1...

result:

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

Test #80:

score: 0
Accepted
time: 200ms
memory: 80828kb

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:

3 4 8 11 13 14 17 22 24 25 26 28 29 32 34 35 38 41 47 54 55 56 57 58 60 62 65 67 68 69 70 74 76 78 81 87 89 90 92 93 95 97 99 100 103 104 106 110 113 114 115 118 122 129 131 132 133 135 140 144 145 147 149 152 153 155 157 158 159 160 163 165 167 168 169 171 172 173 178 179 183 189 190 191 192 194 19...

result:

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

Test #81:

score: 0
Accepted
time: 59ms
memory: 42624kb

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
3 4 5 8 9 10 14 17 18 20 21 23 24 26 31 32 35 36
1 3 4
-1
9 12 13 14 16 18 19 21 22 23 24 27 28 29 30 31 32 33 34 37 38 41 42 43 45 46 47 49 50 51 53 54 58 59 60 63 64 66 69 70 75 77 80 82 84 89 90 91 92 94 99 101 102 104 106 109 111 112 115 118 121 122 124 127 128 129 134 135 136 140 141 142 ...

result:

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

Test #82:

score: 0
Accepted
time: 193ms
memory: 90620kb

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: 66ms
memory: 43360kb

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
2 4 6
-1
-1
-1
-1
2 4
1 2 6
-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
1 3 4 6
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-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: 222ms
memory: 95772kb

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: 216ms
memory: 66196kb

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:

2 4 7 13 16 17 18 19 25 27 30 31 32 33 34 35 37 38 39 40 41 42 44 51 52 53 56 61 63 64 66 68 71 73 79 80 82 86 87 88 89 90 91 101 102 103 105 113 114 121 123 124 126 128 131 132 135 136 141 145 149 151 152 156 160 163 164 166 167 169 170 172 173 174 175 178 179 180 181 182 183 184 187 190 191 192 19...

result:

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

Test #86:

score: 0
Accepted
time: 169ms
memory: 67252kb

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:

33 45 67 132 142 151 162 168 176 177 188 203 210 220 262 268 272 310 312 331 335 354 362 378 392 415 419 428 446 459 460 466 475 500 513 520 530 531 581 599 600 605 619 624 651 660 662 668 672 673 699 709 710 730 757 801 810 815 824 834 844 845 861 865 887 904 909 915 932 935 937 969 974 977 978 979...

result:

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

Test #87:

score: 0
Accepted
time: 145ms
memory: 67212kb

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:

155 176 259 271 304 364 371 382 385 409 413 454 495 592 621 687 707 745 776 838 862 888 897 948 965 982 988 1032 1035 1062 1063 1074 1083 1122 1134 1136 1144 1145 1149 1160 1173 1189 1203 1226 1239 1241 1244 1256 1276 1278 1319 1322 1336 1344 1349 1357 1378 1379 1416 1430 1431 1450 1454 1455 1462 14...

result:

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

Test #88:

score: 0
Accepted
time: 176ms
memory: 66868kb

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:

241 1024 1270 1457 1503 1513 1650 1680 1786 1822 1899 1907 1917 1919 1924 1926 1927 1930 1966 1967 1968 1977 1983 1991 2005 2013 2021 2044 2053 2057 2074 2086 2092 2111 2117 2139 2140 2173 2209 2219 2230 2241 2246 2256 2286 2302 2304 2305 2329 2330 2339 2340 2348 2363 2369 2375 2382 2387 2391 2400 2...

result:

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

Test #89:

score: 0
Accepted
time: 148ms
memory: 66796kb

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:

476 578 691 964 1073 1311 1463 1669 1884 2217 2271 2306 2321 2631 2676 2679 2731 2832 3035 3091 3153 3154 3163 3255 3268 3434 3454 3484 3709 3717 3782 3786 3846 3853 3898 3899 3904 3909 4018 4060 4140 4163 4188 4224 4262 4365 4455 4474 4478 4489 4576 4591 4627 4637 4664 4690 4696 4715 4770 4786 4820...

result:

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

Test #90:

score: 0
Accepted
time: 145ms
memory: 67392kb

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:

498 534 574 595 817 897 1385 1447 1448 1515 1615 1630 1669 1823 1851 1853 1916 1942 2113 2167 2233 2332 2481 2496 2579 2670 2695 2719 2913 2969 3007 3051 3077 3143 3229 3246 3264 3303 3472 3672 3733 3919 3930 3950 3984 3995 4136 4246 4271 4305 4321 4356 4416 4518 4561 4571 4610 4729 4740 4763 4812 4...

result:

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

Test #91:

score: 0
Accepted
time: 146ms
memory: 68164kb

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:

872 931 934 1177 1721 2086 2222 2422 2504 2585 2760 2798 2827 2863 2883 2914 3002 3074 3103 3180 3294 3306 3318 3361 3510 3543 3617 3650 3698 3704 3799 3811 3825 3849 3855 3888 3909 3938 3945 4062 4229 4337 4443 4477 4606 4612 4631 4714 4761 4794 4849 4877 4879 4892 4962 4971 4986 5080 5089 5097 510...

result:

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

Extra Test:

score: 0
Extra Test Passed