QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#870041#8612. The Best Wifeucup-team6313#AC ✓2051ms17472kbC++141.4kb2025-01-25 14:32:252025-01-25 14:33:17

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1 3
3 5
1 2
5 6
4 4

output:

1
1
2
2
3

result:

ok 5 number(s): "1 1 2 2 3"

Test #2:

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

input:

100
67 72
1 100
61 65
87 91
19 77
47 97
3 85
64 97
6 92
33 36
7 27
33 44
13 98
3 62
36 97
26 39
7 35
2 92
8 64
37 83
5 89
26 87
6 96
58 71
49 96
3 85
27 65
16 93
26 70
8 97
1 100
8 93
5 59
9 92
9 99
1 100
8 81
7 66
4 78
12 52
28 42
1 36
2 100
75 81
26 61
8 86
4 44
58 74
29 100
40 77
83 100
39 59
3 9...

output:

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

result:

ok 100 numbers

Test #3:

score: 0
Accepted
time: 285ms
memory: 16220kb

input:

100000
51660 126127
210168 259244
375216 406446
266465 360594
440097 493801
308365 394954
80451 132385
438120 528296
98030 155521
363557 431900
378862 434460
418401 490611
281907 339676
16991 74102
342851 430326
365420 396713
205195 237050
335783 388217
282383 322210
424391 425245
50628 78734
262644...

output:

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

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 671ms
memory: 17472kb

input:

100000
279654 279683
114560 114598
146309 146322
73410 73447
525334 525360
85390 85428
58307 58326
19051 19099
483056 483066
501793 501794
582376 582417
224769 224785
25988 26034
466488 466490
584615 584650
143754 143801
519232 519269
177648 177668
569289 569316
251514 251556
549450 549450
425416 42...

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
96
97
97
98
99
100
10...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 672ms
memory: 16692kb

input:

100000
189531 189531
318904 318905
356703 356704
382461 382462
336886 336886
517948 517948
233087 233088
169086 169087
406440 406441
328975 328975
69232 69233
90576 90576
318793 318793
147047 147047
223016 223016
433644 433644
22071 22072
537114 537115
301926 301926
422619 422619
477755 477756
542 5...

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 100000 numbers

Test #6:

score: 0
Accepted
time: 671ms
memory: 16564kb

input:

100000
57237 57240
176325 176327
42205 42205
17763 17765
49433 49433
572987 572987
25495 25497
149662 149666
24618 24620
446574 446578
432952 432953
229463 229464
578271 578274
592617 592620
257219 257219
315129 315131
407620 407624
366835 366837
216343 216343
136055 136055
166363 166366
595382 5953...

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 100000 numbers

Test #7:

score: 0
Accepted
time: 559ms
memory: 17128kb

input:

200000
358725 449443
325405 346981
192962 383958
400184 526956
28856 105815
22984 194669
58947 146182
179264 244600
449474 589402
325708 511019
64211 189979
355940 468867
434498 534039
321560 324011
145633 326833
263226 422177
186549 354712
201549 385706
199742 384903
439242 526870
115891 201539
315...

output:

1
2
2
2
3
3
3
4
5
5
5
5
5
6
6
6
6
6
6
6
6
6
6
6
6
7
7
7
7
7
7
7
7
7
7
7
7
8
8
8
8
8
8
8
8
9
9
9
9
9
9
9
9
9
9
10
10
10
10
10
10
10
11
11
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
13
13
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
14
1...

result:

ok 200000 numbers

Test #8:

score: 0
Accepted
time: 1367ms
memory: 14240kb

input:

200000
529330 529372
537446 537476
246687 246711
587726 587762
406392 406423
83710 83738
513588 513604
91688 91735
308498 308528
423908 423932
433106 433128
308815 308827
253944 253975
468078 468079
430544 430576
188303 188340
370064 370106
241744 241775
444273 444292
222233 222266
265063 265067
239...

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 200000 numbers

Test #9:

score: 0
Accepted
time: 1337ms
memory: 15084kb

input:

200000
137139 137140
198106 198107
141426 141426
443475 443476
468159 468160
554206 554207
467938 467939
457368 457369
30269 30270
301420 301421
208779 208779
390446 390446
229064 229064
572313 572314
557841 557842
212844 212845
26105 26106
389247 389248
286652 286653
172502 172503
120144 120145
569...

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 200000 numbers

Test #10:

score: 0
Accepted
time: 1329ms
memory: 15464kb

input:

200000
563156 563156
233699 233702
120196 120200
449380 449382
182598 182601
28933 28937
93163 93167
368881 368882
17883 17884
265396 265399
191398 191401
368420 368424
500484 500488
104338 104339
427627 427627
281927 281930
25359 25360
42751 42754
348205 348206
438051 438055
383579 383583
135350 13...

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 200000 numbers

Test #11:

score: 0
Accepted
time: 881ms
memory: 16180kb

input:

300000
298763 514245
247214 298186
184668 202726
317944 534255
318185 394207
311564 501049
354209 400937
32503 216103
135318 316466
48360 50639
437529 524956
362292 440128
399063 483479
190703 481597
413090 455312
232203 353403
287812 435387
581173 586653
420314 450808
100485 309478
426077 510484
25...

output:

1
2
3
3
3
3
3
3
3
4
5
5
5
5
5
5
5
6
6
6
6
6
6
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
8
8
8
8
8
9
9
9
9
9
9
9
10
10
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
12
13
13
1...

result:

ok 300000 numbers

Test #12:

score: 0
Accepted
time: 2051ms
memory: 16012kb

input:

300000
272266 272275
235393 235414
187800 187827
497909 497952
206778 206803
325631 325665
243233 243250
41726 41761
441945 441987
184268 184274
225521 225565
238037 238054
64834 64851
170013 170025
155087 155117
3404 3418
483408 483446
505313 505317
555937 555943
47862 47878
424183 424196
251140 25...

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 300000 numbers

Test #13:

score: 0
Accepted
time: 1982ms
memory: 16096kb

input:

300000
26799 26800
237171 237171
301170 301170
405616 405617
56912 56912
91574 91575
452754 452755
76998 76998
390216 390216
525200 525200
356896 356897
579124 579125
315142 315142
266616 266616
555320 555320
149665 149666
277288 277288
227501 227501
260435 260435
401682 401682
286952 286953
188977 ...

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 300000 numbers

Test #14:

score: 0
Accepted
time: 2005ms
memory: 16700kb

input:

300000
344172 344173
395612 395614
225672 225676
185144 185146
234119 234121
397995 397997
12504 12505
147670 147672
189786 189786
294894 294898
570357 570361
397082 397086
54279 54279
165391 165391
254931 254931
41099 41101
270458 270461
130214 130214
348388 348392
289534 289537
93384 93385
265866 ...

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 300000 numbers

Test #15:

score: 0
Accepted
time: 775ms
memory: 17208kb

input:

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

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 300000 numbers

Test #16:

score: 0
Accepted
time: 521ms
memory: 14872kb

input:

300000
300000 300000
299999 299999
299998 299998
299997 299997
299996 299996
299995 299995
299994 299994
299993 299993
299992 299992
299991 299991
299990 299990
299989 299989
299988 299988
299987 299987
299986 299986
299985 299985
299984 299984
299983 299983
299982 299982
299981 299981
299980 299980...

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 300000 numbers

Test #17:

score: 0
Accepted
time: 599ms
memory: 15808kb

input:

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

output:

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

result:

ok 300000 numbers

Test #18:

score: 0
Accepted
time: 549ms
memory: 14324kb

input:

300000
300000 300001
299999 300000
299998 299999
299997 299998
299996 299997
299995 299996
299994 299995
299993 299994
299992 299993
299991 299992
299990 299991
299989 299990
299988 299989
299987 299988
299986 299987
299985 299986
299984 299985
299983 299984
299982 299983
299981 299982
299980 299981...

output:

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

result:

ok 300000 numbers

Test #19:

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

input:

300000
1 300000
2 300001
3 300002
4 300003
5 300004
6 300005
7 300006
8 300007
9 300008
10 300009
11 300010
12 300011
13 300012
14 300013
15 300014
16 300015
17 300016
18 300017
19 300018
20 300019
21 300020
22 300021
23 300022
24 300023
25 300024
26 300025
27 300026
28 300027
29 300028
30 300029
31...

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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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 300000 numbers

Test #20:

score: 0
Accepted
time: 185ms
memory: 15016kb

input:

300000
300000 599999
299999 599998
299998 599997
299997 599996
299996 599995
299995 599994
299994 599993
299993 599992
299992 599991
299991 599990
299990 599989
299989 599988
299988 599987
299987 599986
299986 599985
299985 599984
299984 599983
299983 599982
299982 599981
299981 599980
299980 599979...

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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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 300000 numbers

Test #21:

score: 0
Accepted
time: 408ms
memory: 17424kb

input:

300000
1 150001
2 150002
3 150003
4 150004
5 150005
6 150006
7 150007
8 150008
9 150009
10 150010
11 150011
12 150012
13 150013
14 150014
15 150015
16 150016
17 150017
18 150018
19 150019
20 150020
21 150021
22 150022
23 150023
24 150024
25 150025
26 150026
27 150027
28 150028
29 150029
30 150030
31...

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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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 300000 numbers

Test #22:

score: 0
Accepted
time: 514ms
memory: 14908kb

input:

300000
450001 450001
450002 450002
450003 450003
450004 450004
450005 450005
450006 450006
450007 450007
450008 450008
450009 450009
450010 450010
450011 450011
450012 450012
450013 450013
450014 450014
450015 450015
450016 450016
450017 450017
450018 450018
450019 450019
450020 450020
450021 450021...

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 300000 numbers

Test #23:

score: 0
Accepted
time: 594ms
memory: 16536kb

input:

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

output:

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

result:

ok 300000 numbers

Test #24:

score: 0
Accepted
time: 579ms
memory: 15752kb

input:

299999
300001 300002
300002 300003
300000 300001
300003 300004
299999 300000
300004 300005
299998 299999
300005 300006
299997 299998
300006 300007
299996 299997
300007 300008
299995 299996
300008 300009
299994 299995
300009 300010
299993 299994
300010 300011
299992 299993
300011 300012
299991 299992...

output:

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

result:

ok 299999 numbers

Extra Test:

score: 0
Extra Test Passed