QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#464343#4205. Art CollectionsDan4Life#50 1497ms66852kbC++231.2kb2024-07-06 01:35:302024-07-06 01:35:31

Judging History

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

  • [2024-07-06 01:35:31]
  • 评测
  • 测评结果:50
  • 用时:1497ms
  • 内存:66852kb
  • [2024-07-06 01:35:30]
  • 提交

answer

#include "art.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
using ar2 = array<int,2>;
using ar3 = array<int,3>;
using ll = long long;
const int mxN = 4010;

int n;
vector<int> v;
bool better[mxN];
map<vector<int>,int> M;

int myPublish(vector<int> V){
	if(M.count(V)) return M[V];
	return M[V] = publish(V);
}

void recur(int l, int r){
	if(l==r) return;
	
	int xd = (r-l+1);
	for(int i = l; i <= r; i++) 
		better[v[i]]=0;
	int st = myPublish(v);
	if(st==0) return;
	while(xd--){
		int b = v[r];
		v.erase(begin(v)+r);
		v.insert(begin(v)+l,b);
		int now = myPublish(v);
		if(now <= st) better[b]=1;
		st = now;
	}
	vector<int> nw; nw.clear();
	for(int i = 0; i < l; i++) nw.pb(v[i]);
	for(int i = l; i <= r; i++) if(better[v[i]]) nw.pb(v[i]);
	for(int i = l; i <= r; i++) if(!better[v[i]]) nw.pb(v[i]);
	for(int i = r+1; i < n; i++) nw.pb(v[i]);
	v.clear(); for(auto u : nw) v.pb(u);
	int mid = (l+r)/2; recur(l,mid); recur(mid+1,r);
}

void solve(int N) {
	n = N; srand(time(NULL));
	v.resize(N,0);
    iota(all(v),1);
    random_shuffle(all(v));
	recur(0,N-1); answer(v);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 4188kb

input:

6
3
8
7
10
11
6
1
3
1
0

output:

942318468 6 5 6 3 2 4 1
942318468 6 1 5 6 3 2 4
942318468 6 4 1 5 6 3 2
942318468 6 2 4 1 5 6 3
942318468 6 3 2 4 1 5 6
942318468 6 6 3 2 4 1 5
942318468 6 5 6 4 3 2 1
942318468 6 4 5 6 3 2 1
942318468 6 6 4 5 3 2 1
942318468 6 6 5 4 3 2 1
539883183 6 6 5 4 3 2 1

result:

ok correct

Test #2:

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

input:

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

output:

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

result:

ok correct

Test #3:

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

input:

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

output:

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

result:

ok correct

Test #4:

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

input:

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

output:

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

result:

ok correct

Test #5:

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

input:

3
2
0
2
1

output:

942318468 3 3 2 1
942318468 3 1 3 2
942318468 3 2 1 3
942318468 3 3 1 2
539883183 3 1 3 2

result:

ok correct

Test #6:

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

input:

6
6
7
12
7
10
7
5
3
3
2
0
2
1

output:

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

result:

ok correct

Test #7:

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

input:

6
7
2
5
10
9
10
3
1
3
2
1
3
0

output:

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

result:

ok correct

Subtask #2:

score: 15
Accepted

Test #8:

score: 15
Accepted
time: 2ms
memory: 3972kb

input:

40
418
403
410
407
370
339
332
349
374
369
372
411
376
353
366
381
412
373
382
401
400
373
374
363
386
413
418
453
424
407
394
423
456
447
414
435
414
425
400
381
209
214
231
214
203
216
231
216
213
194
213
206
215
206
209
216
227
214
213
208
163
156
155
150
157
148
151
152
149
158
142
140
144
144
1...

output:

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

result:

ok correct

Test #9:

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

input:

40
418
403
410
407
370
339
332
349
374
369
372
411
376
353
366
381
412
373
382
401
400
373
374
363
386
413
418
453
424
407
394
423
456
447
414
435
414
425
400
381
209
214
231
214
203
216
231
216
213
194
213
206
215
206
209
216
227
214
213
208
163
156
155
150
157
148
151
152
149
158
142
140
144
144
1...

output:

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

result:

ok correct

Test #10:

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

input:

40
418
403
410
407
370
339
332
349
374
369
372
411
376
353
366
381
412
373
382
401
400
373
374
363
386
413
418
453
424
407
394
423
456
447
414
435
414
425
400
381
209
214
231
214
203
216
231
216
213
194
213
206
215
206
209
216
227
214
213
208
163
156
155
150
157
148
151
152
149
158
142
140
144
144
1...

output:

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

result:

ok correct

Test #11:

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

input:

40
418
403
410
407
370
339
332
349
374
369
372
411
376
353
366
381
412
373
382
401
400
373
374
363
386
413
418
453
424
407
394
423
456
447
414
435
414
425
400
381
209
214
231
214
203
216
231
216
213
194
213
206
215
206
209
216
227
214
213
208
163
156
155
150
157
148
151
152
149
158
142
140
144
144
1...

output:

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

result:

ok correct

Test #12:

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

input:

40
346
369
338
351
360
385
388
405
390
387
406
417
448
419
452
435
442
405
434
461
438
453
442
441
402
383
370
361
354
329
368
333
370
405
372
377
372
351
324
345
200
189
194
211
202
205
188
185
194
213
194
195
202
213
226
221
206
193
208
207
160
159
160
153
160
151
156
151
148
157
144
148
146
142
1...

output:

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

result:

ok correct

Test #13:

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

input:

40
434
411
442
429
420
395
392
375
390
393
374
363
332
361
328
345
338
375
346
319
342
327
338
339
378
397
410
419
426
451
412
447
410
375
408
403
408
429
456
435
180
177
184
195
190
207
210
211
220
209
196
209
200
193
198
179
162
147
162
161
141
148
153
152
149
150
153
144
137
132
132
136
138
134
1...

output:

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

result:

ok correct

Subtask #3:

score: 15
Accepted

Test #14:

score: 15
Accepted
time: 34ms
memory: 5856kb

input:

250
15359
15172
15101
15290
15205
15034
15033
14866
14719
14566
14585
14488
14541
14358
14161
14208
14283
14432
14389
14624
14613
14456
14655
14540
14445
14304
14165
14130
14347
14428
14499
14550
14735
14850
14673
14460
14651
14596
14735
14834
14653
14872
14827
14842
14979
14980
14903
15038
14911
14...

output:

942318468 250 81 69 74 141 55 247 37 237 2 239 72 250 24 236 170 215 84 207 50 145 32 94 6 180 46 79 152 48 158 157 62 54 221 129 104 246 77 92 234 218 150 134 227 192 146 244 29 242 162 229 182 128 240 22 177 108 185 65 179 98 197 11 9 45 220 97 35 154 249 169 212 1 82 151 171 3 73 4 139 91 20 245 ...

result:

ok correct

Test #15:

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

input:

250
15237
15220
15017
15266
15121
15114
15165
15196
15091
14926
14793
14664
14437
14648
14481
14484
14645
14770
14861
14868
14635
14562
14353
14594
14531
14542
14505
14518
14683
14876
14955
15074
15231
15426
15273
15376
15363
15292
15107
15152
15375
15128
15245
15128
15095
14934
15159
15398
15479
15...

output:

942318468 250 81 69 74 141 55 247 37 237 2 239 72 250 24 236 170 215 84 207 50 145 32 94 6 180 46 79 152 48 158 157 62 54 221 129 104 246 77 92 234 218 150 134 227 192 146 244 29 242 162 229 182 128 240 22 177 108 185 65 179 98 197 11 9 45 220 97 35 154 249 169 212 1 82 151 171 3 73 4 139 91 20 245 ...

result:

ok correct

Test #16:

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

input:

250
15766
15953
16024
15835
15920
16091
16092
16259
16406
16559
16540
16637
16584
16767
16964
16917
16842
16693
16736
16501
16512
16669
16470
16585
16680
16821
16960
16995
16778
16697
16626
16575
16390
16275
16452
16665
16474
16529
16390
16291
16472
16253
16298
16283
16146
16145
16222
16087
16214
16...

output:

942318468 250 81 69 74 141 55 247 37 237 2 239 72 250 24 236 170 215 84 207 50 145 32 94 6 180 46 79 152 48 158 157 62 54 221 129 104 246 77 92 234 218 150 134 227 192 146 244 29 242 162 229 182 128 240 22 177 108 185 65 179 98 197 11 9 45 220 97 35 154 249 169 212 1 82 151 171 3 73 4 139 91 20 245 ...

result:

ok correct

Test #17:

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

input:

250
15237
15220
15017
15266
15121
15114
15165
15196
15091
14926
14793
14664
14437
14648
14481
14484
14645
14770
14861
14868
14635
14562
14353
14594
14531
14542
14505
14518
14683
14876
14955
15074
15231
15426
15273
15376
15363
15292
15107
15152
15375
15128
15245
15128
15095
14934
15159
15398
15479
15...

output:

942318468 250 81 69 74 141 55 247 37 237 2 239 72 250 24 236 170 215 84 207 50 145 32 94 6 180 46 79 152 48 158 157 62 54 221 129 104 246 77 92 234 218 150 134 227 192 146 244 29 242 162 229 182 128 240 22 177 108 185 65 179 98 197 11 9 45 220 97 35 154 249 169 212 1 82 151 171 3 73 4 139 91 20 245 ...

result:

ok correct

Test #18:

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

input:

250
15237
15220
15017
15266
15121
15114
15165
15196
15091
14926
14793
14664
14437
14648
14481
14484
14645
14770
14861
14868
14635
14562
14353
14594
14531
14542
14505
14518
14683
14876
14955
15074
15231
15426
15273
15376
15363
15292
15107
15152
15375
15128
15245
15128
15095
14934
15159
15398
15479
15...

output:

942318468 250 81 69 74 141 55 247 37 237 2 239 72 250 24 236 170 215 84 207 50 145 32 94 6 180 46 79 152 48 158 157 62 54 221 129 104 246 77 92 234 218 150 134 227 192 146 244 29 242 162 229 182 128 240 22 177 108 185 65 179 98 197 11 9 45 220 97 35 154 249 169 212 1 82 151 171 3 73 4 139 91 20 245 ...

result:

ok correct

Test #19:

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

input:

250
16856
16617
16626
16677
16498
16385
16186
16011
16188
16123
16056
15891
15710
15807
15748
15581
15350
15163
15150
15023
15264
15463
15578
15775
15548
15385
15496
15439
15292
15099
15006
14809
14792
14785
14784
14537
14476
14359
14400
14479
14668
14847
14726
14673
14866
14949
14924
14887
14956
15...

output:

942318468 250 1 165 203 237 221 86 148 111 73 137 110 144 207 178 51 140 161 247 89 223 127 9 145 168 37 175 79 64 147 179 234 182 100 56 5 163 120 74 190 98 194 49 143 103 245 174 8 77 4 28 248 225 242 105 31 102 138 69 40 152 229 21 180 80 7 228 210 32 192 53 72 151 97 29 132 160 193 201 230 136 5...

result:

ok correct

Subtask #4:

score: 15
Accepted

Test #20:

score: 15
Accepted
time: 119ms
memory: 10520kb

input:

444
50646
50527
50548
50337
50054
50207
50244
50617
50944
50543
50154
50473
50894
50831
50554
50883
50778
51147
51054
50711
50762
50421
50730
50351
50618
50699
50744
50775
50984
51113
51162
50873
50630
50591
50950
50535
50668
50269
49898
50309
50348
50125
49990
49991
50188
50445
50698
51073
50888
50...

output:

942318468 444 368 165 203 425 221 86 148 345 403 137 110 144 207 439 285 140 161 247 89 223 127 9 145 391 262 175 79 359 147 179 234 261 100 56 354 282 120 74 190 98 194 325 143 103 343 308 421 77 4 355 248 225 416 348 295 444 138 69 426 152 286 21 396 316 7 228 299 32 192 53 72 151 342 309 132 160 ...

result:

ok correct

Test #21:

score: 0
Accepted
time: 90ms
memory: 10876kb

input:

444
48005
48156
48487
48480
48167
47864
47775
47834
48087
47664
47329
46992
47371
47066
47241
47658
47373
47436
47041
47142
47319
46878
47289
47406
46977
46816
46873
47202
46879
46918
47151
46954
47339
47152
46859
46904
46929
47076
46821
47202
47423
47838
47539
47862
47645
47534
47719
48160
47899
47...

output:

942318468 444 368 165 203 425 221 86 148 345 403 137 110 144 207 439 285 140 161 247 89 223 127 9 145 391 262 175 79 359 147 179 234 261 100 56 354 282 120 74 190 98 194 325 143 103 343 308 421 77 4 355 248 225 416 348 295 444 138 69 426 152 286 21 396 316 7 228 299 32 192 53 72 151 342 309 132 160 ...

result:

ok correct

Test #22:

score: 0
Accepted
time: 105ms
memory: 10836kb

input:

444
49127
48834
49153
49542
49859
49782
49651
49212
48915
48774
48337
48360
48603
48496
48499
48814
48771
48646
48749
48876
48517
48656
48591
48740
48885
49172
49357
49540
49253
49576
49591
49668
49379
48936
48727
48842
48763
48992
48881
49256
49183
48842
48681
48614
48615
48556
48897
48602
49011
49...

output:

942318468 444 185 319 12 344 424 244 270 175 98 115 303 431 391 149 211 132 440 197 183 316 128 406 83 255 430 140 34 402 5 212 206 86 299 92 330 64 167 317 174 288 310 348 176 294 266 374 142 250 61 377 57 65 28 282 71 31 172 426 227 408 378 35 187 417 137 122 221 411 358 432 341 3 292 230 145 95 2...

result:

ok correct

Test #23:

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

input:

444
49127
48834
49153
49542
49859
49782
49651
49212
48915
48774
48337
48360
48603
48496
48499
48814
48771
48646
48749
48876
48517
48656
48591
48740
48885
49172
49357
49540
49253
49576
49591
49668
49379
48936
48727
48842
48763
48992
48881
49256
49183
48842
48681
48614
48615
48556
48897
48602
49011
49...

output:

942318468 444 185 319 12 344 424 244 270 175 98 115 303 431 391 149 211 132 440 197 183 316 128 406 83 255 430 140 34 402 5 212 206 86 299 92 330 64 167 317 174 288 310 348 176 294 266 374 142 250 61 377 57 65 28 282 71 31 172 426 227 408 378 35 187 417 137 122 221 411 358 432 341 3 292 230 145 95 2...

result:

ok correct

Test #24:

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

input:

444
51416
51165
51208
51585
51694
51775
52182
52329
52068
52007
52200
51839
52130
52287
52084
52379
52810
53145
52776
52925
52728
52635
52780
52621
52388
52593
52514
52869
52728
53079
53234
53575
53150
52853
52604
52195
52616
52781
52358
52071
52176
51849
52036
51815
52018
51879
52014
51657
51960
51...

output:

942318468 444 317 157 122 280 106 362 225 303 23 99 229 375 255 24 172 352 31 88 232 181 160 128 20 53 35 37 3 210 186 93 354 276 70 142 275 374 359 413 243 263 398 230 431 329 173 220 278 409 194 153 135 40 420 167 28 208 5 119 344 320 65 73 412 60 203 322 147 164 15 256 439 199 227 41 2 331 237 90...

result:

ok correct

Test #25:

score: 0
Accepted
time: 93ms
memory: 10636kb

input:

444
53875
54256
53813
54138
54231
53902
53709
53816
53933
53616
53473
53254
53499
53778
53981
54084
53885
53496
53797
53720
53525
53186
53221
53366
53415
53582
53535
53462
53209
53506
53891
53898
54291
54428
54267
54060
53673
53716
53525
53430
53493
53780
53741
53780
53389
53086
53285
53344
53497
53...

output:

942318468 444 317 157 122 280 106 362 225 303 23 99 229 375 255 24 172 352 31 88 232 181 160 128 20 53 35 37 3 210 186 93 354 276 70 142 275 374 359 413 243 263 398 230 431 329 173 220 278 409 194 153 135 40 420 167 28 208 5 119 344 320 65 73 412 60 203 322 147 164 15 256 439 199 227 41 2 331 237 90...

result:

ok correct

Subtask #5:

score: 0
Wrong Answer

Test #26:

score: 0
Wrong Answer
time: 644ms
memory: 35928kb

input:

2000
992102
991801
991814
989859
988944
986991
986654
986529
984866
986507
986380
984973
985696
985963
984930
986273
985836
983843
983504
984241
982886
981353
982292
983641
981912
982063
983288
984159
982728
981357
982488
983983
982102
981389
981932
980471
978622
976987
977344
978657
976980
975157
9...

output:

942318468 2000 1193 1244 1661 377 1401 1417 930 60 987 687 974 1262 859 844 773 1279 277 1843 215 1653 202 1625 1000 594 951 352 1904 1850 389 330 502 1373 382 881 972 1144 663 691 719 1115 334 264 1933 1919 601 1663 1897 741 41 676 226 854 350 354 790 345 864 298 1869 67 1561 1544 1081 1275 825 166...

result:

wrong answer Too many queries

Subtask #6:

score: 0
Wrong Answer

Test #32:

score: 0
Wrong Answer
time: 1497ms
memory: 66852kb

input:

4000
4030896
4033481
4035524
4033521
4033722
4035345
4032308
4031185
4032942
4036583
4036346
4036617
4036208
4039737
4041476
4041317
4039660
4036805
4039892
4038155
4038944
4035121
4031210
4031657
4028498
4028439
4031608
4033277
4029764
4032937
4032986
4033509
4034718
4035009
4034826
4037981
4036292...

output:

942318468 4000 1277 1283 654 1197 2872 2730 2019 128 3869 3570 340 2568 2613 3033 3779 1221 2629 2776 2341 3810 685 2527 3056 437 1958 2094 2933 134 2507 3864 1433 242 3689 3702 2205 2055 2480 3557 1261 1276 3315 25 3239 3025 3609 2133 859 3189 1269 3338 2180 326 2222 3713 1156 1137 459 2738 3654 81...

result:

wrong answer Too many queries