QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#459976#8837. Increasing IncomeMysterious_CatAC ✓31ms7464kbC++141.0kb2024-06-30 18:15:212024-06-30 18:15:22

Judging History

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

  • [2024-06-30 18:15:22]
  • 评测
  • 测评结果:AC
  • 用时:31ms
  • 内存:7464kb
  • [2024-06-30 18:15:21]
  • 提交

answer

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

const int N = 2e5 + 5;

int T, n, tot, p[N], low[N], pos[N], pre[N], rk[N];

void work() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> p[i];
		rk[p[i]] = i;
	}
	tot = 0;
	for (int i = 1; i <= n; i++) {
		if (!tot || low[tot] < p[i]) {
			low[++tot] = p[i], pos[tot] = i, pre[i] = pos[tot - 1];
		}
		else {
			int x = lower_bound(low + 1, low + tot + 1, p[i]) - low;
			low[x] = p[i], pos[x] = i, pre[i] = pos[x - 1];
		}
	}
	for (int i = tot - 1; i >= 1; i--) {
		pos[i] = pre[pos[i + 1]];
	}
	pos[++tot] = n + 1, p[n + 1] = n + 1;
	for (int i = 1; i < tot; i++) {
		int l = pos[i], r = pos[i + 1];
		cout << l << ' ';
		for (int j = l + 1; j < r; j++) {
			if (p[j] < p[r]) {
				cout << j << ' ';
			}
		}
		for (int j = p[l] + 1; j < p[r]; j++) {
			if (rk[j] < r) {
				cout << rk[j] << ' ';
			}
		}
	}
	cout << '\n';
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> T;
	while (T--) {
		work();
	}

	return 0;
}

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

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 5596kb

input:

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

output:

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

result:

ok Correct (3 test cases)

Test #2:

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

input:

153
4
2 4 3 1
4
1 4 2 3
5
2 1 4 5 3
5
1 4 5 3 2
4
1 3 2 4
5
1 5 2 4 3
5
5 3 1 2 4
5
4 1 2 5 3
5
1 2 5 3 4
5
3 1 4 2 5
5
5 4 2 3 1
5
2 1 5 4 3
5
3 4 1 5 2
5
1 4 3 5 2
5
5 1 3 4 2
5
5 3 2 4 1
5
1 5 3 2 4
5
2 4 3 1 5
5
1 5 4 3 2
5
1 2 4 5 3
5
4 2 5 3 1
5
1 3 5 2 4
5
3 1 4 5 2
3
2 1 3
5
1 2 4 3 5
5
5 1 ...

output:

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

result:

ok Correct (153 test cases)

Test #3:

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

input:

873
6
1 5 2 4 6 3
6
5 1 6 4 3 2
4
1 4 3 2
6
2 1 6 5 4 3
6
4 5 1 3 6 2
6
6 2 1 5 4 3
5
1 5 4 3 2
6
1 2 6 3 5 4
4
2 1 3 4
6
1 6 4 2 3 5
6
6 1 3 5 2 4
6
2 1 4 5 3 6
6
3 4 1 5 2 6
6
4 1 5 2 6 3
6
5 2 1 4 6 3
6
4 1 6 2 3 5
6
5 1 3 4 6 2
6
6 2 5 4 1 3
6
6 2 5 1 4 3
6
5 2 3 6 4 1
6
6 1 2 5 4 3
6
2 3 4 6 1 ...

output:

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

result:

ok Correct (873 test cases)

Test #4:

score: 0
Accepted
time: 4ms
memory: 5668kb

input:

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

output:

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

result:

ok Correct (5913 test cases)

Test #5:

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

input:

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

output:

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

result:

ok Correct (1 test case)

Test #6:

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

input:

1
199998
159356 10750 153350 164169 60898 196950 131049 134811 60561 70652 176518 102541 105130 65353 149432 130188 173045 164607 163412 153724 32758 147227 182545 85204 57248 16735 82120 111602 57653 159065 22964 103722 109260 9336 171010 86014 69411 157929 59663 125254 16608 189879 107804 171722 6...

output:

110 64 338 782 878 985 1012 1071 1329 848 1346 1694 1704 1763 2032 2442 2447 2460 519 2480 2518 2743 2781 2440 1903 2852 2918 3166 107 2468 3284 1470 1356 1286 1729 3340 3341 3372 3397 3499 528 2803 1434 2429 3560 3817 3861 3953 3964 3969 3999 4304 1365 3092 4328 1221 3534 4384 4467 4527 4569 4591 4...

result:

ok Correct (1 test case)

Test #7:

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

input:

1
199996
156367 73915 97649 141585 131431 35194 94499 149597 90231 68402 176577 126196 34713 113693 83310 180924 120175 156193 133140 4561 70990 99456 103240 121210 81210 107743 55697 132797 23544 154453 157350 125727 196386 110178 192898 57871 51021 38601 73157 32030 40397 73787 113854 194095 83934...

output:

385 1210 1804 1953 2016 1716 3104 1725 3156 3432 4141 4187 4198 2915 4199 3169 4159 3884 4229 4507 4624 4684 4941 4959 4991 5349 5450 5557 872 3869 2139 937 3622 2034 81 4895 4109 1068 908 5617 5659 5806 6056 4603 5229 2614 3306 4920 4501 4612 3972 901 6102 919 2687 6108 6221 1459 811 4646 6230 6249...

result:

ok Correct (1 test case)

Test #8:

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

input:

1
199998
98505 79151 87039 2 8 70517 9 158359 171019 186783 152554 4317 101323 16 21 7500 22 26 41 63419 178156 42 41526 43466 72590 51657 174757 157400 48 49 51 66204 129927 175402 35852 54 56 197638 107370 32158 58498 127659 89402 65 104664 129513 187594 72 191798 149749 8858 157141 192786 73 1462...

output:

4 5 7 14 15 17 18 19 22 29 30 31 36 37 44 48 54 58 64 68 69 71 72 75 81 83 85 86 98 101 107 108 111 112 116 118 119 120 127 128 132 135 137 138 139 142 145 146 149 150 153 158 161 165 166 167 169 174 176 177 178 182 184 185 186 189 191 193 205 207 212 213 214 219 224 227 228 231 232 234 235 237 241 ...

result:

ok Correct (1 test case)

Test #9:

score: 0
Accepted
time: 30ms
memory: 6936kb

input:

1
199998
73517 194602 5 111588 68425 192815 25134 92278 84469 33841 158795 71227 8 120655 190420 187346 192801 183788 95375 90457 70190 81113 9 9389 118156 10 66216 106656 65445 149875 12 19 163255 94699 167297 144213 17999 29143 75988 21 106202 12996 193475 104553 1402 60665 84193 174139 174714 120...

output:

3 13 23 26 31 32 40 54 66 77 79 93 95 96 105 107 120 129 130 136 137 147 148 149 157 160 167 168 170 175 186 190 196 202 205 212 230 233 234 240 243 246 247 249 250 258 259 260 262 282 287 294 304 311 312 313 315 321 322 332 342 347 361 363 373 374 380 384 387 389 400 401 403 412 420 425 426 427 429...

result:

ok Correct (1 test case)

Test #10:

score: 0
Accepted
time: 20ms
memory: 7360kb

input:

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

output:

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

result:

ok Correct (1 test case)

Test #11:

score: 0
Accepted
time: 15ms
memory: 7412kb

input:

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

output:

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

result:

ok Correct (1 test case)

Test #12:

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

input:

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

output:

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

result:

ok Correct (1 test case)

Test #13:

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

input:

1
200000
30974 121063 167953 12100 50579 164098 148209 124533 884 159163 76691 24130 103098 191960 142802 164511 196543 42000 145348 7612 136181 77714 111474 111270 159227 171383 101731 181697 190181 168357 54977 118274 110665 111243 20989 47455 139664 126116 149561 118233 32712 188535 188401 21923 ...

output:

202 960 1065 1267 648 1242 1396 549 9 1613 1697 1050 2042 2193 2250 2406 2529 1381 1199 905 2171 401 2747 2784 3127 1872 1393 676 365 3199 3540 3043 421 2857 2044 2608 1703 3546 3576 3635 3674 649 1376 1973 4008 4313 4330 4375 4408 2607 1673 3970 275 809 4565 4608 3249 4683 4741 4747 4823 778 4446 3...

result:

ok Correct (1 test case)

Test #14:

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

input:

1
199997
118022 2 87562 3 19823 105259 61919 4 6 111584 7 8 11 100287 12 13 111157 112063 98915 14 19 168521 20 21 24 25 17951 159194 26 28 29 120902 32 33 38 39 41 190563 95904 111192 119677 57550 42 43 42336 51 129733 144409 148266 54 2150 55 58 149147 66 67 68 70509 70 72 8068 185456 73 74 132091...

output:

2 4 8 9 11 12 13 15 16 20 21 23 24 25 26 29 30 31 33 34 35 36 37 43 44 46 50 52 53 55 56 57 59 60 63 64 66 67 69 71 72 74 76 77 78 80 84 89 90 91 93 94 95 96 98 99 101 102 104 105 106 108 111 112 114 115 116 118 119 120 121 122 124 127 130 134 136 137 138 142 143 144 146 147 148 149 151 153 155 156 ...

result:

ok Correct (1 test case)

Test #15:

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

input:

2
53064
2 3 5 6 8 12079 40252 24881 9 9068 10 11 40481 9588 12 42587 19 46902 35223 10513 27953 20 897 33128 22 23 24 26 28 31 321 29136 32 23363 34 41837 29496 35 49952 8874 36 45434 39 6124 42 45 50819 8334 46 39948 6396 448 40510 18250 45656 48 49 32201 4775 51 52 53 22249 33414 54 32961 56 58 62...

output:

1 2 3 4 5 9 11 12 15 17 22 25 26 27 28 29 30 33 35 38 41 43 45 46 49 56 57 60 61 62 65 67 68 69 70 72 73 78 79 81 83 87 93 94 95 96 97 99 100 102 104 106 107 108 109 110 111 112 113 115 117 118 119 121 122 126 127 131 133 134 138 142 143 146 152 153 155 157 159 160 162 163 164 166 167 168 169 170 17...

result:

ok Correct (2 test cases)

Test #16:

score: 0
Accepted
time: 17ms
memory: 6768kb

input:

2
86135
86135 86134 86133 86132 86131 86130 86129 86128 86127 86126 86125 86124 86123 86122 86121 86120 86119 86118 86117 86116 86115 86114 86113 86112 86111 86110 86109 86108 86107 86106 86105 86104 86103 86102 86101 86100 86099 86098 86097 86096 86095 86094 86093 86092 86091 86090 86089 86088 8608...

output:

27067 8393 47591 53683 66394 66393 66392 66391 66390 66389 66388 66387 66386 66385 66384 66383 66382 66381 66380 66379 66378 66377 66376 66375 66374 66373 66372 66371 66370 66369 66368 66367 66366 66365 66364 66363 66362 66361 66360 66359 66358 66357 66356 66355 66354 66353 66352 66351 66350 66349 6...

result:

ok Correct (2 test cases)

Test #17:

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

input:

2
114819
47642 61038 22397 92750 16235 33773 60172 108370 74901 4486 5301 37119 80308 33979 76639 57751 65494 24159 24383 52273 109212 102076 10634 94818 12177 87060 89859 48179 94154 26702 3395 100096 34474 5173 30593 88815 30980 107578 108820 30868 29642 38547 10453 71690 65321 70841 7733 22394 10...

output:

88 274 111 428 444 479 493 604 408 644 649 610 715 756 903 966 1069 1124 1174 1225 1230 1292 1299 1338 1542 1691 1715 1741 1752 495 1476 1168 1804 2016 2094 2240 2295 2309 2314 1198 2428 2456 2502 2514 2599 2668 2808 2813 2838 2904 3039 3056 3093 1164 503 220 3156 2397 3180 3292 3344 3353 3420 3576 ...

result:

ok Correct (2 test cases)

Test #18:

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

input:

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

output:

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

result:

ok Correct (2 test cases)

Test #19:

score: 0
Accepted
time: 15ms
memory: 7360kb

input:

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

output:

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

result:

ok Correct (2 test cases)

Test #20:

score: 0
Accepted
time: 14ms
memory: 7024kb

input:

2
50532
50532 50531 50530 4582 50528 50527 50526 50525 50524 50523 50522 50521 50520 50519 50518 50517 50516 50515 50514 50513 50512 50511 50510 50509 50508 50507 50506 50505 50504 50503 50502 50501 50500 50499 50498 50497 50496 50495 50494 50493 50492 50491 50490 50489 50488 50487 50486 50485 50484...

output:

4 77 7161 21169 32590 43283 43282 43281 43280 43279 43278 43277 43276 43275 43274 43273 43272 43271 43270 43269 43268 43267 43266 43265 43264 43263 43262 43261 43260 43259 43258 43257 43256 43255 43254 43253 43252 43251 43250 43249 43248 43247 43246 43245 43244 43243 43242 43241 43240 43239 43238 43...

result:

ok Correct (2 test cases)

Test #21:

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

input:

2
48027
48027 48026 48025 48024 48023 48022 48021 48020 48019 48018 48017 48016 48015 48014 48013 48012 48011 48010 48009 48008 48007 48006 48005 48004 48003 48002 48001 48000 47999 47998 47997 47996 47995 47994 47993 47992 47991 47990 47989 47988 47987 47986 47985 47984 47983 47982 47981 47980 4797...

output:

26162 42292 42291 42290 42289 42288 42287 42286 42285 42284 42283 42282 42281 42280 42279 42278 42277 42276 42275 42274 42273 42272 42271 42270 42269 42268 42267 42266 42265 42264 42263 42262 42261 42260 42259 42258 42257 42256 42255 42254 42253 42252 42251 42250 42249 42248 42247 42246 42245 42244 ...

result:

ok Correct (2 test cases)

Test #22:

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

input:

2
49149
45766 44322 13524 49120 34313 14453 22762 45456 41101 33066 37810 6641 41698 20814 13880 43329 11181 45323 32254 23011 45806 45872 40933 31796 19164 38537 42260 43496 38735 36980 37199 46512 40784 2549 39978 15892 15157 33270 28109 42921 1752 3868 18354 5145 7481 29180 32231 4790 42843 28705...

output:

62 283 467 54 557 158 581 635 321 80 636 115 653 750 769 596 456 735 696 301 780 824 831 832 841 853 864 866 873 933 946 1001 1071 1102 1144 1208 541 1340 1382 1388 1390 1408 1416 1437 825 449 1438 1499 1505 279 81 630 1121 1335 1549 1598 1599 1605 90 779 1253 1607 1710 1725 1753 1755 1777 1787 1816...

result:

ok Correct (2 test cases)

Test #23:

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

input:

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

output:

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

result:

ok Correct (2 test cases)

Test #24:

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

input:

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

output:

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

result:

ok Correct (2 test cases)

Test #25:

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

input:

3
509
509 508 507 506 505 504 503 502 501 500 499 498 497 496 495 494 493 492 491 490 489 488 487 486 485 484 483 218 481 480 479 478 477 476 475 474 473 472 471 470 469 468 467 423 465 464 463 462 461 460 459 458 457 456 455 454 453 452 451 450 449 448 447 446 445 444 443 442 441 440 439 438 437 43...

output:

340 424 380 453 452 451 450 449 448 447 446 445 444 443 442 441 440 439 438 437 436 435 434 433 228 431 430 429 428 427 426 425 93 423 422 421 420 419 418 417 416 415 414 413 412 411 410 409 408 407 406 405 404 403 402 401 400 399 398 397 396 395 394 393 392 391 390 389 388 387 386 385 98 383 382 38...

result:

ok Correct (3 test cases)

Test #26:

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

input:

4
25729
20211 20067 14578 18311 17364 8977 10955 7789 20973 12765 10672 17087 2155 11717 13581 2775 14625 19352 3147 15942 13111 4876 15266 5564 19286 21127 18956 11282 9474 3384 14545 12111 14039 9216 211 21798 12568 7663 19844 23275 15780 24373 24393 4460 11442 1025 16311 16345 8513 7746 3458 3671...

output:

99 35 130 160 133 129 249 290 299 337 374 378 273 46 389 392 60 394 398 405 427 437 445 480 574 620 622 317 473 246 632 637 648 653 672 680 191 71 341 353 691 295 710 403 586 722 761 285 647 484 772 790 810 826 828 836 851 860 881 902 905 921 959 983 986 1012 1018 1036 114 684 1056 1093 1094 1125 11...

result:

ok Correct (4 test cases)

Test #27:

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

input:

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

output:

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

result:

ok Correct (5 test cases)

Test #28:

score: 0
Accepted
time: 22ms
memory: 6192kb

input:

6
7149
1 6 3300 108 5212 4381 2962 7132 9 14 15 2713 2358 18 97 19 1438 1621 25 26 4487 6123 28 33 6200 137 3898 38 3629 4354 4560 39 40 3621 44 1803 6036 4036 1747 45 2716 1197 46 3062 48 791 49 6131 4035 52 2442 53 219 56 60 61 65 5119 68 1215 70 72 74 75 76 79 80 81 83 2678 3406 85 1734 86 87 189...

output:

1 2 9 10 11 14 16 19 20 23 24 28 32 33 35 40 43 45 47 50 52 54 55 56 57 59 61 62 63 64 65 66 67 68 69 72 74 75 77 80 81 15 82 83 4 85 86 90 92 93 95 96 99 101 108 110 114 119 120 26 124 126 127 128 130 135 138 141 143 146 148 152 155 156 159 160 161 163 164 165 168 170 171 173 174 175 177 178 180 18...

result:

ok Correct (6 test cases)

Test #29:

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

input:

7
16819
16819 16818 16817 16816 16815 16814 16813 16812 16811 16810 16809 16808 16807 16806 16805 16804 16803 16802 16801 16800 16799 16798 16797 16796 16795 16794 16793 16792 16791 16790 16789 16788 16787 16786 16785 16784 16783 16782 16781 16780 16779 16778 16777 16776 16775 16774 16773 16772 1677...

output:

366 12126 13659 13658 13657 13656 13655 13654 13653 13652 13651 13650 13649 13648 13647 13646 13645 13644 13643 13642 13641 13640 13639 13638 13637 13636 13635 13634 13633 13632 13631 13630 13629 13628 13627 13626 13625 13624 13623 13622 13621 13620 13619 13618 13617 13616 13615 13614 13613 13612 13...

result:

ok Correct (7 test cases)

Test #30:

score: 0
Accepted
time: 22ms
memory: 6176kb

input:

8
29021
10222 11342 22280 369 11843 9665 3980 8073 2610 18065 18445 16127 13357 22715 12601 985 6693 14535 9819 3527 28638 11358 19593 16379 23694 11672 6310 26298 1682 6919 24373 24923 25103 14059 9413 21658 3996 6139 13267 10845 19838 5125 28643 7211 8305 10766 13203 16405 26653 23720 28866 22039 ...

output:

4 54 63 67 82 115 126 159 16 173 193 207 65 213 234 267 128 29 273 276 287 291 296 313 317 338 348 377 392 394 413 414 441 457 461 81 470 298 451 472 475 476 489 490 518 533 201 92 380 553 565 580 589 590 598 610 613 620 623 627 628 631 648 188 415 656 657 659 662 663 677 688 693 721 729 741 756 765...

result:

ok Correct (8 test cases)

Test #31:

score: 0
Accepted
time: 16ms
memory: 5880kb

input:

9
37136
37136 37135 37134 37133 37132 37131 37130 37129 37128 37127 37126 37125 37124 37123 37122 37121 37120 37119 37118 37117 37116 37115 37114 37113 37112 37111 37110 37109 37108 37107 37106 37105 37104 37103 37102 37101 37100 37099 37098 37097 37096 37095 37094 37093 37092 37091 37090 37089 3708...

output:

7249 24644 24643 24642 24641 24640 24639 24638 24637 24636 24635 24634 24633 24632 24631 24630 24629 24628 24627 24626 24625 24624 24623 24622 24621 24620 24619 24618 24617 24616 24615 24614 24613 24612 24611 24610 24609 24608 24607 24606 24605 24604 24603 24602 24601 24600 24599 24598 24597 24596 2...

result:

ok Correct (9 test cases)

Test #32:

score: 0
Accepted
time: 22ms
memory: 6152kb

input:

10
5543
4867 587 1 2 5 4153 7 8 9 10 3205 2299 13 2501 3733 4939 14 1921 15 577 4169 16 2794 20 24 25 28 30 2508 1346 32 3535 36 2642 38 4209 40 5044 2983 440 45 2522 3560 1769 47 50 51 53 54 56 4498 3939 57 3701 58 63 3893 3222 64 3285 66 3226 67 68 69 70 71 72 453 73 4493 76 77 3521 4075 78 79 121...

output:

3 4 5 7 8 9 10 13 17 19 22 24 25 26 27 28 31 33 35 37 41 45 46 47 48 49 50 53 55 56 59 61 63 64 65 66 67 68 70 72 73 76 77 80 83 85 87 88 90 93 96 97 99 100 101 102 103 104 106 107 110 111 114 115 119 121 122 125 126 127 130 131 133 134 135 139 142 143 144 145 147 152 153 156 158 160 161 162 163 164...

result:

ok Correct (10 test cases)

Test #33:

score: 0
Accepted
time: 20ms
memory: 4340kb

input:

11
13188
3211 4858 1756 11101 7924 3 7258 6541 9725 4436 1705 13094 5325 4336 1837 13034 621 6463 6292 10855 5617 8390 10267 10347 7086 1503 10273 6741 256 3883 1819 8243 6908 9189 4 7 1571 9 5143 6716 10 8547 12119 4535 6815 12782 9155 12 5080 9550 8496 4432 11660 12321 10927 12071 345 12774 8890 4...

output:

6 35 36 38 41 48 61 67 70 97 101 102 105 111 120 122 134 139 147 167 181 182 183 194 195 197 176 199 200 203 211 216 222 225 232 236 238 247 249 252 255 263 272 29 274 277 278 281 286 287 288 291 301 305 315 89 319 327 344 346 347 57 356 366 373 375 376 377 237 382 386 391 408 434 435 437 438 455 45...

result:

ok Correct (11 test cases)

Test #34:

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

input:

12
14387
2032 2092 7297 5303 9380 6643 1162 8743 13244 10344 7779 8685 4162 6630 13229 9206 13492 3549 1646 6533 12121 7138 425 4605 6117 4656 14074 7015 11462 12023 12147 12647 8475 5979 12365 4217 12160 12753 13137 6811 7606 8037 11753 7339 13498 5059 9144 10048 340 1598 7238 1061 10786 3374 13104...

output:

140 198 152 218 106 167 64 266 267 49 295 375 23 433 110 455 476 493 524 568 569 571 585 595 661 664 707 709 730 732 712 662 349 243 211 162 85 737 753 759 769 209 76 587 777 112 580 141 497 644 408 313 191 436 779 803 810 813 291 351 290 499 829 831 146 838 841 846 853 879 903 919 673 819 785 557 3...

result:

ok Correct (12 test cases)

Test #35:

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

input:

13
31585
25526 23165 15629 16745 22764 15380 17226 175 21983 4024 18503 7138 13386 29184 14458 20426 13711 5129 27026 1014 29177 13497 6929 1511 29414 227 1665 11904 25568 13620 24853 30180 17753 17190 14470 13883 31127 20692 22539 18320 11973 29075 17299 20722 8431 14274 2211 31142 17570 8120 11017...

output:

560 148 886 671 995 799 1002 1052 1075 723 8 26 834 603 1103 1120 1210 1220 1326 1121 267 1446 1254 1456 1500 1366 836 972 530 1604 525 70 1274 1198 122 1269 1409 1805 463 1483 1106 1806 1896 1898 426 103 714 1491 1262 1906 1270 173 205 1915 398 1327 141 155 1598 1059 1201 662 588 1936 1944 1988 205...

result:

ok Correct (13 test cases)

Test #36:

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

input:

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

output:

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

result:

ok Correct (14 test cases)

Test #37:

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

input:

15
5328
1 2 4 5 6 3529 7 8 9 11 12 3777 13 14 15 997 16 4447 19 5048 20 23 24 25 2918 26 27 28 2202 31 32 33 3143 569 34 4812 2403 35 36 38 39 2088 40 42 43 4041 44 370 4824 3639 2720 4401 45 46 48 49 50 51 53 54 55 56 2024 57 59 2586 3395 60 62 63 65 66 69 1156 71 72 73 74 75 76 77 78 79 80 933 677...

output:

1 2 3 4 5 7 8 9 10 11 13 14 15 17 19 21 22 23 24 26 27 28 30 31 32 35 38 39 40 41 43 44 45 47 53 54 55 56 57 58 59 60 61 62 64 65 68 69 70 71 72 73 75 76 77 78 79 80 81 82 83 84 88 89 91 92 93 94 95 96 97 99 101 102 103 105 107 109 111 112 113 114 115 116 117 118 119 120 121 123 124 125 127 128 130 ...

result:

ok Correct (15 test cases)

Test #38:

score: 0
Accepted
time: 15ms
memory: 3700kb

input:

100
2336
1793 2295 1529 43 168 1116 1484 1521 2242 2028 1733 1104 543 586 667 822 2254 391 1981 857 348 493 1948 1790 1834 1726 1800 1112 1416 425 193 995 971 1098 247 1477 1261 1962 1827 803 1503 1308 1345 1490 218 2260 1310 621 347 1320 228 2078 166 1108 1973 1397 2174 1619 1075 1941 289 843 665 8...

output:

4 5 31 45 51 53 35 61 65 74 76 87 90 49 21 18 92 95 30 105 111 118 119 121 122 129 131 134 145 146 156 158 22 166 176 110 13 89 14 177 153 179 193 196 197 199 202 207 209 214 221 224 227 233 242 48 243 244 250 251 253 254 263 267 268 270 271 272 275 127 75 212 63 15 277 279 287 289 290 291 292 296 3...

result:

ok Correct (100 test cases)

Test #39:

score: 0
Accepted
time: 20ms
memory: 5608kb

input:

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

output:

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

result:

ok Correct (101 test cases)

Test #40:

score: 0
Accepted
time: 13ms
memory: 5676kb

input:

102
8381
1 4352 3358 4986 3 5 6 1414 10 18 19 3394 2419 2109 6485 5679 5207 20 21 22 24 577 1288 803 25 28 29 7663 34 36 37 1285 40 264 4636 41 7646 5678 44 3431 3393 1768 45 4655 500 7162 7025 3214 46 47 7361 6879 50 3013 7816 51 2940 3412 820 276 1408 52 14 3151 8140 54 4708 56 4215 64 65 66 4887 ...

output:

1 5 6 7 9 10 11 18 19 20 21 25 26 27 29 30 31 33 36 39 43 49 50 53 56 62 63 66 68 70 71 72 75 76 78 80 84 86 87 91 92 93 98 100 102 103 104 110 113 114 116 117 118 119 120 121 123 126 127 129 130 132 135 137 139 141 143 145 147 150 156 160 161 162 165 166 167 168 171 172 173 177 178 124 180 181 182 ...

result:

ok Correct (102 test cases)

Test #41:

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

input:

103
1976
917 2 4 551 8 10 11 131 12 13 1309 15 681 16 18 1762 19 20 1972 21 1072 22 23 25 29 124 31 32 33 454 34 35 39 40 41 42 43 45 46 47 48 1716 1593 1560 1362 50 1932 51 1138 52 53 54 58 633 60 36 61 62 63 64 65 283 671 1094 1037 66 1039 67 68 70 1844 71 1700 387 72 74 110 75 76 30 1220 77 78 79...

output:

2 3 5 6 7 9 10 12 14 15 17 18 20 22 23 24 25 27 28 29 31 32 33 34 35 36 37 38 39 40 41 46 48 50 51 52 53 55 56 57 58 59 60 61 66 68 69 70 72 75 76 78 79 80 82 83 84 85 88 91 92 94 95 96 97 98 99 101 102 103 105 106 107 109 111 113 114 115 116 118 119 77 121 122 125 126 90 127 128 129 130 26 131 132 ...

result:

ok Correct (103 test cases)

Test #42:

score: 0
Accepted
time: 16ms
memory: 5668kb

input:

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

output:

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

result:

ok Correct (104 test cases)

Test #43:

score: 0
Accepted
time: 16ms
memory: 5672kb

input:

105
1344
1188 1079 853 842 1311 994 127 322 970 1289 1274 871 727 1005 647 1195 656 1329 849 1266 1006 345 874 1175 101 968 934 387 129 979 776 1106 917 771 773 441 759 392 1343 954 1165 50 1164 1330 83 113 75 858 430 953 98 351 1178 287 616 139 344 539 1333 384 950 1231 611 601 1249 269 813 671 112...

output:

85 109 118 121 42 138 143 154 132 47 45 166 174 86 89 51 25 183 184 46 145 196 231 148 7 29 56 234 236 252 253 260 265 274 281 287 291 159 76 156 294 296 251 157 99 87 303 308 314 315 334 105 257 75 250 337 339 340 348 361 365 369 201 387 392 288 347 170 256 246 323 360 282 66 83 165 84 332 203 254 ...

result:

ok Correct (105 test cases)

Test #44:

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

input:

1000
1284
241 188 967 1220 11 1230 586 1170 427 128 978 1185 765 1103 125 191 915 80 815 1091 137 803 543 1236 278 650 253 1041 307 1074 1245 1239 664 548 953 788 713 1129 863 205 614 293 452 386 152 933 718 259 911 698 323 261 33 63 937 757 1254 32 405 922 1223 626 473 549 1168 606 320 554 277 401 ...

output:

5 53 54 58 81 119 120 124 18 149 116 95 82 170 15 198 10 101 21 99 199 211 218 219 249 252 255 269 271 147 45 169 320 325 333 341 366 368 375 383 356 114 244 386 388 396 398 399 404 406 408 428 435 453 456 457 469 472 479 484 217 153 148 2 16 361 489 491 508 511 514 310 458 40 495 284 432 313 415 30...

result:

ok Correct (1000 test cases)

Test #45:

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

input:

1001
151
151 150 149 148 147 146 145 144 143 142 141 140 60 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 97 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 116 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 ...

output:

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

result:

ok Correct (1001 test cases)

Test #46:

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

input:

1002
182
166 43 93 41 106 127 57 135 170 73 182 92 119 22 46 55 66 130 117 49 21 30 138 151 47 88 131 25 171 112 132 108 174 10 167 142 62 125 175 146 34 156 71 120 32 86 61 128 35 159 96 72 59 45 102 9 7 65 107 94 91 20 121 77 5 3 82 139 56 176 80 155 104 4 180 95 44 116 145 69 158 111 12 78 38 165...

output:

21 14 28 34 22 45 41 49 56 57 62 65 66 74 83 85 4 88 2 77 54 15 25 20 90 92 93 16 69 7 96 53 97 99 47 37 58 17 80 43 52 10 100 101 102 105 64 84 91 71 89 67 108 111 46 26 114 115 61 12 3 60 76 51 117 55 73 106 5 59 32 118 119 120 82 30 103 109 78 19 13 44 63 112 121 123 125 126 129 131 38 6 48 18 27...

result:

ok Correct (1002 test cases)

Test #47:

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

input:

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

output:

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

result:

ok Correct (1003 test cases)

Test #48:

score: 0
Accepted
time: 15ms
memory: 5612kb

input:

1004
322
89 11 228 2 212 162 244 287 8 5 220 261 227 126 151 12 14 16 21 32 22 41 122 233 142 23 31 27 34 43 225 94 198 47 48 146 49 190 298 61 51 76 53 55 110 81 56 221 37 138 58 107 64 66 158 67 3 68 69 91 70 71 117 77 239 86 165 176 19 251 83 109 78 80 82 33 10 15 102 85 87 273 196 28 93 52 97 99...

output:

4 10 9 2 16 17 18 19 21 26 28 27 20 29 22 30 34 35 37 41 43 44 47 49 51 40 53 54 56 57 58 59 61 62 42 64 69 73 74 46 75 76 77 78 71 80 66 81 84 1 60 85 86 32 87 88 79 89 52 90 92 72 45 93 94 95 96 97 63 98 23 99 100 101 102 14 103 104 105 106 107 109 111 113 50 115 116 117 25 120 121 123 124 36 125 ...

result:

ok Correct (1004 test cases)

Test #49:

score: 0
Accepted
time: 15ms
memory: 5572kb

input:

1005
508
132 76 426 29 334 493 502 458 205 35 80 307 14 358 339 146 440 171 233 508 124 445 498 118 257 104 116 125 112 77 184 211 40 96 99 456 13 155 122 366 24 342 399 200 4 293 210 484 338 239 164 273 179 454 270 66 78 61 49 496 315 421 160 86 303 223 91 499 170 457 253 79 246 143 506 20 310 175 ...

output:

4 10 13 33 37 41 45 56 2 30 57 58 59 11 64 67 72 76 80 85 88 34 35 26 95 100 104 29 106 27 24 39 21 28 112 113 115 1 74 16 38 63 51 110 118 119 121 123 126 69 18 107 78 53 31 44 9 97 47 32 66 87 19 50 73 128 129 130 71 25 131 55 52 114 120 98 133 134 135 138 139 46 116 111 86 65 12 105 140 143 144 1...

result:

ok Correct (1005 test cases)

Test #50:

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

input:

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

output:

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

result:

ok Correct (10000 test cases)

Test #51:

score: 0
Accepted
time: 20ms
memory: 5596kb

input:

10001
19
1 2 6 4 5 3 7 9 8 10 13 18 11 12 15 16 17 14 19
7
4 3 1 7 5 2 6
4
3 4 1 2
19
17 3 4 10 19 7 12 2 18 1 11 13 15 14 5 6 16 8 9
11
4 9 10 3 8 2 5 1 6 11 7
14
7 5 9 3 14 11 1 8 4 10 2 12 13 6
7
1 2 7 6 3 4 5
1
1
18
17 10 8 13 16 6 3 1 15 2 9 14 7 18 12 11 5 4
48
1 21 3 27 5 20 7 8 9 10 39 12 14...

output:

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

result:

ok Correct (10001 test cases)

Test #52:

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

input:

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

output:

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

result:

ok Correct (10002 test cases)

Test #53:

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

input:

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

output:

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

result:

ok Correct (10003 test cases)

Test #54:

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

input:

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

output:

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

result:

ok Correct (10004 test cases)

Test #55:

score: 0
Accepted
time: 20ms
memory: 5612kb

input:

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

output:

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

result:

ok Correct (10005 test cases)

Test #56:

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

input:

99995
1
1
3
2 1 3
2
1 2
3
3 1 2
1
1
1
1
2
2 1
2
1 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2 1
5
1 5 3 4 2
1
1
1
1
1
1
1
1
1
1
5
1 2 3 4 5
2
1 2
1
1
1
1
2
1 2
2
1 2
4
3 1 2 4
2
1 2
5
2 5 3 1 4
2
2 1
1
1
4
1 2 3 4
4
1 2 3 4
3
3 2 1
2
1 2
2
2 1
1
1
3
3 1 2
1
1
3
2 3 1
5
3 1 5 2 4
2
1 2
1
1
6
4 1 3 5 2 6
1
...

output:

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

result:

ok Correct (99995 test cases)

Test #57:

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

input:

99996
2
1 2
1
1
1
1
1
1
1
1
1
1
1
1
2
2 1
1
1
1
1
1
1
4
3 4 2 1
2
1 2
2
1 2
1
1
1
1
2
1 2
2
1 2
1
1
1
1
2
2 1
2
1 2
1
1
3
2 3 1
2
1 2
1
1
1
1
1
1
1
1
1
1
2
1 2
4
1 2 3 4
1
1
3
2 3 1
1
1
2
1 2
1
1
2
1 2
4
1 2 3 4
1
1
2
2 1
5
5 4 3 2 1
1
1
3
1 2 3
1
1
1
1
4
1 2 3 4
4
1 4 3 2
2
1 2
2
1 2
1
1
2
1 2
4
1 ...

output:

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

result:

ok Correct (99996 test cases)

Test #58:

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

input:

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

output:

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

result:

ok Correct (99997 test cases)

Test #59:

score: 0
Accepted
time: 15ms
memory: 5616kb

input:

99998
2
1 2
4
2 1 4 3
3
3 2 1
1
1
2
1 2
1
1
2
1 2
1
1
4
2 1 3 4
2
1 2
3
3 1 2
3
1 2 3
1
1
1
1
1
1
2
1 2
6
2 1 3 4 5 6
1
1
1
1
2
1 2
1
1
4
1 3 2 4
1
1
2
1 2
1
1
1
1
1
1
4
4 3 2 1
6
2 1 4 3 5 6
1
1
1
1
3
1 2 3
1
1
1
1
1
1
5
1 4 5 3 2
1
1
1
1
6
5 1 2 6 3 4
1
1
2
1 2
1
1
6
1 2 3 4 5 6
1
1
5
1 2 3 4 5
1
...

output:

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

result:

ok Correct (99998 test cases)

Test #60:

score: 0
Accepted
time: 15ms
memory: 5536kb

input:

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

output:

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

result:

ok Correct (99999 test cases)

Test #61:

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

input:

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

output:

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

result:

ok Correct (100000 test cases)

Extra Test:

score: 0
Extra Test Passed