QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#419559#8643. Board Gameegypt_ioi2024_01#3 3023ms358620kbC++232.1kb2024-05-24 02:20:322024-05-24 02:20:33

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 11ms
memory: 27424kb

input:

3000 3000 3000
2378 2385
1560 2450
189 2980
44 1140
425 1843
167 1563
439 2010
7 951
1311 1370
1305 2085
150 1600
16 2469
431 2674
317 2191
1845 2918
2195 2917
1210 1577
125 1049
911 1160
504 2060
376 2420
1676 2969
1343 1576
284 1869
835 1989
273 1330
234 1906
1482 1524
2415 2460
388 2897
2177 2600...

output:

76
52
40
54
67
54
62
36
44
32
60
61
58
29
34
22
64
25
31
33
14
79
80
58
68
29
67
69
47
60
48
55
45
11
24
51
17
24
47
29
50
57
89
54
62
63
55
61
7
41
61
27
64
60
63
55
44
43
39
48
57
47
65
65
55
43
51
48
22
57
47
28
52
51
50
61
41
61
69
50
41
53
42
58
45
26
60
52
30
56
47
56
32
55
44
58
56
71
69
41
6...

result:

ok 3000 lines

Test #2:

score: 3
Accepted
time: 110ms
memory: 220516kb

input:

30000 30000 30000
11640 15443
5731 12870
5066 28442
11803 29263
2399 20658
4911 11282
676 1962
10390 19686
6117 6722
22155 28614
2932 14721
11403 13488
6697 22434
19113 26975
20347 20663
15743 16072
19116 25652
10891 19389
1373 27384
14607 29107
6192 29223
7196 10267
15467 16280
21828 26032
365 982
...

output:

2610
3673
15
7659
10149
8209
878
4102
7582
10483
6418
6826
11546
12814
11394
7792
9097
7484
14575
913
5802
584
8172
961
7434
8828
14665
7642
14032
6284
8299
3040
9576
4953
47
13721
10634
3362
9103
4901
4022
11866
14548
5132
9252
13165
143
9494
2845
13149
5616
3023
13560
12315
8126
2002
5706
10657
14...

result:

ok 30000 lines

Test #3:

score: 3
Accepted
time: 222ms
memory: 358620kb

input:

50000 49999 50000
23237 38489
46903 47222
463 17722
5061 37126
21771 23294
4851 25450
408 41933
1298 5353
8952 44686
5842 17741
15835 33052
16401 17274
33117 33174
7070 24079
22424 46115
5336 6340
35165 36940
3308 36325
12014 20182
391 48629
9736 42693
5246 46582
22861 48389
3338 6669
31354 49668
11...

output:

8988
372
12633
8934
15728
15677
431
10910
20467
16345
10441
16923
12383
15090
11112
19353
21485
9819
17810
3071
41
99
8479
9616
1173
13790
1142
14800
19055
675
1086
2353
22330
18271
2373
11286
20247
21236
18133
11260
2792
19399
9049
18056
14190
3523
22890
19479
14288
9335
561
19226
12836
11409
8485
...

result:

ok 50000 lines

Test #4:

score: 3
Accepted
time: 76ms
memory: 358360kb

input:

49900 50000 100
21419 22725
19367 26559
4942 22766
16196 32249
12443 43575
17415 32668
3559 30282
6024 31186
4553 32107
1085 24970
27857 48472
15126 48937
22784 33748
16961 18301
21066 30382
41567 46191
17677 42298
2910 32294
14609 16464
14131 44143
8413 13472
17266 18767
567 48263
2410 29825
22159 ...

output:

4729
6824
18742
805
16289
4349
1296
5007
15785
15606
18374
4228
1685
19748
16689
7552
13232
5985
19529
7256
13074
6094
12823
7464
19302
3985
5081
4794
2513
6637
10664
6726
11115
11493
10542
4882
2626
10108
17287
690
8100
6464
10436
3789
14356
11646
18179
20174
19124
1188
20268
1232
4167
127
1224
166...

result:

ok 49900 lines

Subtask #2:

score: 0
Time Limit Exceeded

Test #5:

score: 7
Accepted
time: 135ms
memory: 28244kb

input:

3000 3000 3000
1391 1542
299 1578
1346 1528
46 1259
1513 2261
201 1717
56 1635
199 2327
847 882
1977 2161
465 1954
1723 2580
482 2105
906 2207
747 2742
2026 2845
1565 1809
295 311
278 2408
1215 2583
520 832
464 638
1223 1346
1799 2703
1022 2717
887 2160
619 2109
165 2478
879 1343
319 2463
56 815
109...

output:

25
47
29
15
51
29
39
23
47
39
23
39
27
39
5
39
19
26
30
31
43
32
39
86790
24
13
86787
52
31
24
36
22
33
31
32
22
36
43
24
25
30
32
86793
31
49
34
31
31
39
21
33
86793
34
40
23
43
44
37
32
37
48
86790
33
86783
42
46
28
86787
15
47
43
42
41
39
38
14
34
42
33
86775
24
37
36
12
14
28
47
43
34
27
45
41
1...

result:

ok 3000 lines

Test #6:

score: 7
Accepted
time: 2371ms
memory: 217796kb

input:

30000 30000 30000
15802 26734
1581 27129
4313 12830
7001 28197
5489 10268
11838 19275
11260 21410
3519 29279
932 23073
8888 28355
17227 29224
1060 5702
20326 25420
1598 14082
15716 27167
4982 19730
4497 8783
15068 19181
7588 9083
4816 21808
15694 24819
4716 27198
14003 15119
5397 11717
3612 20613
24...

output:

24
115
79
159
99
71
180
64
116
142
81
167
114
82
77
198
78
113
174
176
56
201
118
96
94
101
68
230
86
143
87
114
130
176
157
148
28
33
32
118
122
158
109
111
95
94
71
193
64
80
105
104
91
71
66
84
99
106
71
63
79
110
91
156
160
170
109
104
71
90
157
52
164
119
74
64
147
34
52
30
0
100
24
92
64
119
6...

result:

ok 30000 lines

Test #7:

score: 7
Accepted
time: 3023ms
memory: 358432kb

input:

50000 49999 125
274 4495
31902 38170
22094 45892
23403 29854
4496 14675
6736 31591
19339 49660
36467 46207
33868 48663
14410 45594
9616 33814
2297 31602
18150 27372
14438 41157
43354 46408
5615 13800
22514 23053
22773 49388
19461 38226
5507 7948
11643 24820
11391 38028
7115 37842
9224 12555
13589 48...

output:

4319
150
1049596
3018
1051387
6808
1048715
1051913
2625
11955
6901
1052632
1900
3878
1049818
1022
12158
1047204
6442
5902
1047367
1049174
6510
9229
6254
1049925
5769
9246
1051028
10434
5546
10747
1049879
3140
10567
5573
4000
1047848
11408
11383
1811
8147
4195
8949
6004
1050586
11951
7123
3888
3658
2...

result:

ok 50000 lines

Test #8:

score: 7
Accepted
time: 2920ms
memory: 358500kb

input:

50000 49999 2
26543 34943
12250 26278
6204 24347
36237 39171
11034 49123
7144 33180
2990 25335
2251 39474
31973 45365
33351 34163
10927 47972
3664 14721
4199 43871
27639 42806
10237 16625
1778 45127
10244 19433
35019 48812
20255 21208
5313 29153
26739 37090
11449 15687
44991 45942
4554 30455
28860 3...

output:

382
7478
11481
18981
2544
6193
6969
19085
22018
14003
12388
6715
6439
9079
21756
17912
20366
19619
17354
11694
9872
9970
6126
1758
16802
1706
3430
4090
1718
11345
7684
1093
17573
9008
21625
15160
2181
8417
18895
5862
5353
9266
539
2926
11278
10332
20648
21133
1616
4111
11289
15144
17751
4278
16583
5...

result:

ok 50000 lines

Test #9:

score: 0
Time Limit Exceeded

input:

49900 50000 42252
31673 34001
3171 49595
37687 48457
25040 31103
4835 47250
25324 40443
21968 40072
23116 45237
17324 31804
3492 39449
22950 37705
3268 26931
18426 38071
4309 20249
11732 38687
11281 24273
4078 5861
1111 2202
36679 39285
7779 49424
17122 41344
18695 19877
16943 36716
17973 48599
2340...

output:


result:


Subtask #3:

score: 0
Time Limit Exceeded

Test #13:

score: 7
Accepted
time: 137ms
memory: 27916kb

input:

3000 3000 3000
997 1695
884 1068
654 1853
6 520
947 2382
787 2407
818 1795
2347 2718
46 1560
1180 2169
582 1881
1080 1766
770 2877
365 419
365 749
1315 2536
223 1867
216 545
1311 1952
1598 2796
141 620
1681 2938
301 2204
866 1710
872 961
369 466
2160 2936
2295 2359
1310 1744
1572 2088
1111 2618
1680...

output:

357
518
350
113
154
370
718
974
1389
588
1322
215
670
9
870
488
375
195
1102
149
1373
944
303
508
1217
19
920
646
699
713
1152
1247
555
751
80
50
584
1361
149
921
140
1183
989
667
455
198
180
813
472
71
112
169
331
600
666
31
860
145
1090
207
496
654
825
1330
278
112
690
1152
885
1412
94
96
771
132
...

result:

ok 3000 lines

Test #14:

score: 7
Accepted
time: 2368ms
memory: 221456kb

input:

30000 30000 30000
5947 19048
4004 18741
10068 24221
13216 23775
14185 17633
2653 21744
87 19566
5657 19635
24673 28265
5039 14021
8019 20341
7620 25285
6719 8806
15262 25748
14231 28690
21585 29569
27254 27866
12665 29102
2884 11669
2014 11831
1927 26375
9676 21506
2114 28403
18249 27263
4937 8497
6...

output:

85
57
80
39
77
77
60
56
36
92
75
63
85
80
77
67
16
70
86
82
70
63
80
58
64
54
64
29
20
26
67
74
88
18
86
99
47
60
82
100
67
32
58
59
77
69
61
30
59
61
65
58
49
17
64
24
36
63
88
57
53
78
100
107
63
58
69
66
78
81
1
79
71
48
75
57
18
75
72
82
18
71
47
57
80
45
40
71
17
86
82
72
69
73
82
10
40
75
30
1...

result:

ok 30000 lines

Test #15:

score: 0
Time Limit Exceeded

input:

50000 49999 441
13752 26461
12830 19173
15097 24108
15105 23445
30568 37149
29121 37388
16853 36388
2332 23106
13884 16343
21870 29420
34697 37322
4611 28878
24104 32433
845 2981
23606 39164
10978 27227
23850 45495
28376 45550
14768 19049
36431 48725
37372 44220
4070 7856
37328 38334
22032 37320
277...

output:

147
109
95
133
85
88
117
115
123
128
118
123
83
105
164
166
47
129
107
57
140
19
92
110
108
121
105
66
107
134
122
39
181
55
91
111
185
149
124
81
96
103
86
137
140
155
99
38
68
118
115
66
102
117
159
203
106
83
144
66
85
103
91
91
78
116
85
111
77
20
90
93
103
87
96
116
72
92
77
140
99
92
46
148
10...

result:


Subtask #4:

score: 0
Wrong Answer

Test #23:

score: 19
Accepted
time: 62ms
memory: 18416kb

input:

1500 3000 2
432 1120
324 1221
37 294
50 931
588 1149
178 887
460 517
268 533
649 935
123 1291
642 1025
1145 1489
630 1375
163 1407
842 1004
155 1300
296 1049
380 840
215 1224
283 981
211 1056
75 725
325 1437
591 680
1179 1253
876 1425
382 1230
1065 1436
612 784
121 770
349 633
140 1168
443 1019
103 ...

output:

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

result:

ok 1500 lines

Test #24:

score: 19
Accepted
time: 132ms
memory: 27772kb

input:

3000 2999 5
1183 2619
603 1077
245 1639
988 1253
70 2760
2292 2975
2483 2998
851 1914
214 968
1902 2025
1636 2835
62 2320
2082 2708
267 1972
613 2739
1273 2062
2173 2928
1028 1532
417 2184
291 899
608 2280
922 1566
670 1218
1023 1213
1193 2777
1142 2410
532 1558
67 1473
1041 1652
146 1877
727 2468
5...

output:

79
79
73
72
58
44
91
58
84
78
57
26
82
33
20
109
42
73
114
63
87
59
75
42
87
117
71
56
97
17
29
87
105
40
107
143
44
41
83
101
22
13
88
97
19
40
71
70
15
113
89
97
64
90
66
112
28
88
126
56
50
17
115
17
69
83
92
23
48
135
50
53
77
71
88
87
93
54
25
15
112
69
73
30
72
66
10
66
88
67
67
90
74
78
75
28...

result:

ok 3000 lines

Test #25:

score: 19
Accepted
time: 126ms
memory: 27128kb

input:

3000 2999 376
1269 2828
540 2100
459 2192
1176 2286
1449 1461
2568 2836
511 1436
1580 2036
1623 1837
554 2879
2222 2286
1316 2997
280 337
870 1575
77 2864
10 1424
588 2960
677 2959
254 548
691 1544
346 1337
591 2329
151 1896
305 2577
742 819
1544 2646
679 2071
219 2786
1732 2454
61 1247
1535 2704
10...

output:

684
874
611
580
355
22
246
797
0
415
770
67087
853
67274
298
68077
884
433
110
68087
67193
293
67294
323
705
221
696
67242
33
62
858
242
58
67176
67031
29
67210
67036
67136
805
267
759
28
239
67064
68055
67036
336
67107
67022
316
442
234
703
766
113
373
184
68070
29
717
59
67128
214
825
409
201
6809...

result:

ok 3000 lines

Test #26:

score: 19
Accepted
time: 144ms
memory: 27928kb

input:

2990 3000 25
926 979
752 2267
861 2664
92 2235
1338 1549
5 1674
394 2828
198 2419
328 1655
2230 2675
1946 2452
1460 2590
306 2972
27 1195
1755 2511
38 1631
1518 1734
2799 2869
54 514
1022 2346
410 845
491 2867
1604 2130
666 1955
817 1398
1738 2230
220 495
595 771
470 2755
413 2945
1437 2785
2545 276...

output:

91
109
165
96
123
129
155
223
166
164
99
195
129
276
192
6
193
256
207
105
322
245
208
268
329
251
246
240
97
223
199
97
159
328
52
61
8
160
221
244
0
216
61
309
190
119
63
276
89
226
255
100
286
12
225
224
303
171
220
107
281
84
195
66
164
93
257
131
250
151
170
248
131
98
131
93
129
7
60
280
275
9...

result:

ok 2990 lines

Test #27:

score: 19
Accepted
time: 97ms
memory: 19800kb

input:

2000 3000 14
1723 1954
51 1183
799 1742
871 1087
676 1997
1886 1899
1513 1564
707 1128
222 1168
482 1740
855 1066
550 794
273 1511
986 1515
424 1672
1610 1621
234 563
693 1022
472 624
959 1123
1145 1588
236 514
731 1361
179 608
174 1607
489 1501
945 1757
681 1911
139 1343
1542 1741
1413 1577
1122 16...

output:

1058
550
906
1731
1423
446
1329
951
1557
599
544
478
271
1549
1360
441
546
473
113
53
303
305
207
183
600
993
1404
1585
1733
1645
1427
1008
824
1552
198
1418
8
1170
957
908
162
866
341
910
737
828
1041
1252
505
1478
450
1157
1633
312
1087
1366
467
1026
273
128
385
613
132
1631
690
822
1244
112
1238
...

result:

ok 2000 lines

Test #28:

score: 19
Accepted
time: 85ms
memory: 22168kb

input:

2000 3000 10
150 1892
195 1292
917 1351
1099 1320
173 1902
388 1264
478 1558
366 1590
1837 1981
789 1209
879 1066
930 989
658 965
238 1597
1153 1162
1061 1092
13 640
1142 1396
1885 1924
294 1959
612 1557
156 1523
409 852
973 1143
195 1368
12 1152
14 423
735 1259
586 1563
669 1266
608 1971
74 1552
26...

output:

149
350
478
4
461
288
495
454
504
316
487
341
238
517
22
84
58
454
186
201
312
465
229
259
268
283
365
239
308
158
516
47
519
240
75
180
448
30
122
23
94
278
80
463
299
130
306
216
507
339
479
487
56
6
261
239
52
377
8
257
268
81
125
10
18
75
420
24
201
312
366
43
508
131
428
31
510
125
361
233
138
...

result:

ok 2000 lines

Test #29:

score: 19
Accepted
time: 84ms
memory: 19020kb

input:

1500 3000 2040
408 1258
481 1455
313 691
517 975
167 776
123 500
87 104
88 718
1006 1271
264 995
238 806
153 883
828 1280
550 766
1050 1208
515 1300
714 976
883 1441
812 1248
121 1267
1380 1430
1030 1145
390 895
459 541
743 1034
604 929
1080 1440
920 1002
515 1017
454 980
233 1434
669 1298
859 1077
...

output:

4
4
5
6
6
6
6
5
7
5
3
6
5
6
4
5
7
6
6
5
5
6
4
8
7
5
6
6
5
4
4
8
6
7
5
5
5
6
5
6
6
4
5
6
5
5
4
5
5
6
7
3
7
6
6
5
5
6
4
5
3
4
6
5
5
6
6
6
5
6
6
6
6
7
6
6
5
6
6
3
4
5
4
6
5
6
6
3
4
7
7
6
6
6
4
5
6
6
4
5
8
5
6
5
6
6
5
5
6
6
5
6
7
4
5
7
6
6
6
5
6
5
6
7
6
6
6
6
7
7
5
6
7
6
7
5
6
4
8
6
7
7
6
6
7
5
4
6
5
7
...

result:

ok 1500 lines

Test #30:

score: 19
Accepted
time: 117ms
memory: 27800kb

input:

3000 3000 3000
1528 2408
111 2158
441 1045
1694 2126
2919 2988
1756 1793
7 916
474 704
396 1861
716 2441
58 211
664 1295
325 1675
1175 1335
1564 1946
166 1623
1432 2641
129 1407
169 1865
839 2184
696 1366
640 1443
1555 1680
302 2348
1347 2113
2054 2567
2829 2881
1579 2042
298 1123
1303 2476
181 655
...

output:

81001
138001
72001
105001
129001
93001
120001
165001
141001
135001
147001
63001
138001
60001
108001
159001
144001
60001
111001
63001
150001
138001
78001
144001
132001
138001
69001
60001
75001
66001
183001
48001
165001
75001
162001
138001
90001
84001
87001
99001
108001
171001
165001
84001
135001
4800...

result:

ok 3000 lines

Test #31:

score: 19
Accepted
time: 98ms
memory: 23156kb

input:

2244 3000 2
1428 1429
1943 1946
687 689
913 914
1454 1455
608 609
917 919
2119 2120
423 424
2021 2023
116 120
1246 1249
2042 2043
211 212
1636 1639
327 330
116 117
1637 1638
1965 1966
1873 1875
433 435
1411 1412
631 634
1719 1720
363 364
2114 2115
970 971
665 666
779 780
596 597
1757 1758
993 995
12...

output:

1373
1372
1372
1371
1370
1370
1369
1368
1368
1367
1366
1366
1364
1365
1364
1363
1362
1362
1361
1360
1360
1359
1359
1358
1358
1357
1356
1356
1355
1354
1354
1352
1353
1350
1352
1351
1350
1348
1349
1348
1347
1346
1346
1345
1344
1344
1343
1343
1342
1342
1341
1341
1340
1340
1339
1338
1338
1336
1337
1336
...

result:

ok 2244 lines

Test #32:

score: 19
Accepted
time: 96ms
memory: 23436kb

input:

2267 3000 2
1351 1352
287 288
2202 2204
814 816
2056 2057
923 927
1757 1758
901 902
431 432
1510 1511
147 150
787 788
1192 1193
130 134
2166 2167
129 131
1062 1064
917 920
1990 1991
1948 1949
990 994
1525 1526
81 83
1652 1653
401 403
1332 1333
1485 1487
136 138
192 193
189 191
1189 1190
1853 1854
93...

output:

405
407
407
406
403
405
404
401
403
402
401
399
400
397
399
399
398
395
397
396
393
395
394
391
393
392
389
391
390
389
387
388
387
385
386
385
383
384
383
381
382
381
379
380
379
377
378
377
375
376
375
374
373
373
372
371
371
369
370
369
367
368
365
367
366
365
363
364
363
362
361
361
359
360
357
...

result:

ok 2267 lines

Test #33:

score: 19
Accepted
time: 109ms
memory: 23828kb

input:

2403 3000 3
2375 2376
1467 1468
565 570
302 306
450 451
522 523
2333 2334
1606 1607
341 342
1684 1685
331 332
61 62
706 707
299 300
1809 1810
1062 1063
769 773
73 74
234 235
408 410
1780 1781
865 866
829 831
139 141
1542 1543
1992 1993
957 958
449 452
1944 1945
1840 1841
1486 1491
1083 1084
2071 207...

output:

1350
1352
1351
1347
1350
1349
1348
1344
1347
1346
1345
1344
1341
1343
1342
1341
1338
1340
1339
1338
1335
1337
1336
1332
1335
1334
1333
1332
1329
1331
1330
1326
1329
1329
1328
1327
1323
1326
1326
1325
1324
1320
1323
1322
1321
1320
1317
1319
1318
1317
1314
1316
1315
1311
1314
1314
1313
1312
1308
1311
...

result:

ok 2403 lines

Test #34:

score: 19
Accepted
time: 101ms
memory: 22904kb

input:

2497 2995 4
1641 1642
1004 1005
1121 1126
1314 1315
2490 2491
2336 2338
1664 1670
565 566
1577 1578
1147 1148
1090 1091
2304 2310
2236 2238
334 336
1513 1514
1712 1713
1138 1139
1648 1649
1135 1137
1241 1245
567 568
2044 2045
2047 2048
842 843
1291 1292
124 126
1340 1344
612 614
1833 1834
453 454
86...

output:

1225
1225
1224
1223
1221
1222
1221
1220
1219
1218
1217
1217
1216
1215
1213
1214
1213
1212
1209
1211
1210
1209
1205
1208
1207
1206
1205
1201
1204
1203
1202
1201
1200
1197
1199
1198
1197
1193
1196
1195
1194
1193
1189
1192
1191
1190
1189
1185
1188
1187
1186
1185
1181
1184
1183
1182
1177
1181
1180
1179
...

result:

ok 2497 lines

Test #35:

score: 19
Accepted
time: 107ms
memory: 27396kb

input:

2742 2991 10
1913 1914
1397 1398
2683 2684
2187 2188
1824 1825
1209 1210
834 835
2388 2389
529 530
879 881
498 499
1490 1491
202 203
854 855
1136 1137
2077 2078
1842 1843
473 483
1967 1968
253 254
2125 2126
722 723
514 515
884 885
302 313
570 571
943 944
1315 1316
1071 1072
1557 1558
32 33
93 94
837...

output:

525
527
526
525
524
523
522
521
520
519
518
517
515
516
515
514
513
512
511
510
509
508
507
506
505
505
504
503
502
501
500
499
498
497
495
496
495
494
493
492
491
490
489
488
487
486
485
485
484
483
482
481
480
479
478
477
476
475
475
474
473
472
471
470
469
468
467
466
466
465
464
463
462
461
460
...

result:

ok 2742 lines

Test #36:

score: 19
Accepted
time: 112ms
memory: 27760kb

input:

3000 3000 2
1727 2505
72 1472
1664 2340
1703 2262
1359 2007
431 2090
191 300
91 642
1988 2803
593 602
1436 2696
568 1759
65 354
1593 1952
2052 2489
132 2894
1190 1199
526 1762
1802 1938
2226 2765
802 1357
472 1744
3 2331
1965 2578
1182 2347
1833 2280
290 2692
2476 2835
509 2202
1576 2164
249 1125
18...

output:

358
952
441
762
1006
1380
838
1391
1420
1480
1481
919
612
987
708
716
1185
1427
848
98
562
521
668
1394
207
164
13
1347
24
465
226
269
1340
944
1158
1233
700
796
834
791
1169
448
107
1449
54
136
1430
25
208
105
1322
316
919
26
831
1265
561
274
295
953
396
843
543
1106
333
399
56
1020
498
655
1447
19...

result:

ok 3000 lines

Test #37:

score: 19
Accepted
time: 119ms
memory: 27944kb

input:

3000 3000 50
1443 2318
1665 1972
245 1795
889 1012
1988 2779
2271 2403
2292 2843
290 492
722 1502
569 2100
291 1794
47 2025
1383 1461
306 1592
478 2598
1959 2440
379 856
1414 1467
1567 2322
1575 2653
2535 2884
1224 1771
1177 1706
1724 2286
795 2407
356 1284
1884 1915
1233 1853
1545 2423
74 1774
1373...

output:

1912
352
82
254
675
1143
2816
140
32
1216
1987
1582
935
1455
1759
812
189
726
343
2131
2003
1238
161
2788
1986
2109
2359
1877
235
2060
904
1028
860
2405
3103
1163
2143
259
2702
1656
336
718
2149
2397
2419
341
715
1343
1158
1460
2112
1328
463
1976
1663
593
2760
65
736
1376
27
2457
877
3101
2057
2436
...

result:

ok 3000 lines

Test #38:

score: 19
Accepted
time: 118ms
memory: 27148kb

input:

3000 3000 100
597 660
550 1131
654 2848
1387 2474
1173 2889
33 2948
1155 1170
256 520
547 2829
1050 1252
303 746
837 1081
53 1376
1618 2769
1007 2250
2041 2328
1504 2441
213 433
314 1004
40 2766
1977 2626
527 2530
1016 1453
1327 1567
1884 2943
322 708
2474 2706
460 1872
1517 1794
1382 1880
1382 2355...

output:

2251
181
1044
426
843
31
670
329
28
2298
2038
208
147
821
1899
179
247
1396
226
2283
5172
2267
903
2032
9537
1088
6930
812
1366
892
2313
2547
2536
2169
2050
290
284
3437
2695
1759
1532
1916
223
1038
315
1749
493
2256
747
1725
4610
2095
2021
2672
10624
61
79
676
1421
1718
2643
980
1298
441
164
943
99...

result:

ok 3000 lines

Test #39:

score: 19
Accepted
time: 118ms
memory: 28016kb

input:

3000 3000 250
1528 1764
99 2184
2024 2541
1153 1885
747 2534
81 2172
2217 2878
152 2284
1703 2432
526 690
1028 1990
679 2700
154 2975
667 1915
1709 2269
340 2995
578 2992
808 2867
855 1827
567 1156
662 2289
1850 2080
2271 2852
67 784
597 1543
63 365
1852 2367
1548 2159
1642 2277
471 2604
1584 2097
8...

output:

37357
15594
619
6565
4
2092
1101
57625
4576
54572
1981
245
31219
2195
340
1383
2008
940
12
465
1802
1364
1736
387
1237
1572
30377
1703
1742
580
10519
1745
55462
236
2231
43743
1350
38222
2135
450
1265
1506
1319
356
1602
1828
1937
31691
1915
2155
1750
31
737
53681
6295
1095
55424
687
144
623
1024
436...

result:

ok 3000 lines

Test #40:

score: 19
Accepted
time: 118ms
memory: 30340kb

input:

2998 2998 2
319 860
194 1950
1556 1883
1622 2210
541 1156
868 2612
2018 2350
5 1172
259 1292
835 1272
48 134
1168 2008
1055 1840
53 1166
1386 2829
1109 2865
2195 2487
2465 2662
2049 2623
9 2385
90 1517
230 521
1711 2220
459 2917
539 1718
1100 2810
253 1451
621 2045
1082 2548
197 2866
718 2563
673 20...

output:

2051
1639
979
1613
1307
2709
1862
2205
1829
2325
1406
1982
410
1493
2739
2593
110
2253
523
359
2727
2287
467
848
965
2101
1086
1012
1852
2039
488
2742
2788
1497
2028
1390
57
2881
538
2212
427
1612
714
62
2183
2267
1098
396
15
2079
1538
2450
186
1916
2545
2821
9
1729
611
612
2893
2312
2142
1514
830
7...

result:

ok 2998 lines

Test #41:

score: 19
Accepted
time: 115ms
memory: 27032kb

input:

2998 2998 10
1337 2347
907 1782
1626 2481
1718 2400
640 2652
625 1748
464 1569
1782 2747
1495 1516
543 1034
97 2831
680 925
1722 2798
1550 2307
190 1048
618 819
2467 2656
466 1161
1912 2076
2340 2916
1907 2284
1561 1588
1037 1243
386 559
1232 1240
1539 2055
1752 2197
1047 1111
25 2884
1688 2634
626 ...

output:

555
10793
246
82
9640
9750
10039
526
1
9968
834
9233
987
9368
10381
566
10195
9085
631
112
10206
9378
10607
10839
338
10603
10032
787
9725
10326
9523
539
8971
817
9923
8970
627
9321
455
476
10791
10485
373
10347
10807
10071
10576
9396
255
10468
9990
9007
36
629
311
83
10112
10328
10175
9931
9062
935...

result:

ok 2998 lines

Test #42:

score: 19
Accepted
time: 123ms
memory: 27228kb

input:

2998 2998 100
148 1783
155 830
2527 2675
404 1784
926 951
533 2141
147 2675
691 2742
1183 2957
418 814
303 1723
2582 2643
1251 1909
1900 2532
2172 2713
767 2498
1724 2659
1764 2341
782 1616
189 421
186 1710
284 1926
1107 1426
328 1124
1503 1838
1304 1684
608 2106
1354 2008
1466 2657
1707 2478
915 97...

output:

745
98881
99463
98609
182
98728
273
97575
97961
984
98790
97585
25
731
99365
824
99180
98303
303
98253
862
98938
98453
4
494
98307
98711
99266
98714
190
99406
98317
97886
99211
98910
98862
99089
306
640
99371
97630
642
98419
424
356
750
98426
442
97767
98007
972
98535
132
98328
347
564
99205
98151
9...

result:

ok 2998 lines

Test #43:

score: 0
Wrong Answer
time: 66ms
memory: 30368kb

input:

3000 2999 3000
1040 1690
368 2961
1699 2478
1353 1650
1707 1856
1608 2417
2760 2872
629 2691
1259 1609
853 1863
440 1894
2051 2462
368 2037
1458 1722
925 1032
697 2369
22 1102
1498 1601
285 2358
1356 2653
435 2347
1093 1783
354 2611
2257 2559
1103 1930
1308 1867
964 1084
422 1306
1421 2473
235 1051
...

output:

1000000000
1029001
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1026001
1000000000
1000000000
1000000000
2538001
153001
1698001
1000000000
2292001
1000000000
1887001
1000000000
1000000000
1000000000
1746001
975001
1000000000
1000000000
2244001
1000000000
10...

result:

wrong answer 1st lines differ - expected: '8637001', found: '1000000000'

Subtask #5:

score: 0
Time Limit Exceeded

Test #44:

score: 0
Time Limit Exceeded

input:

50000 49999 2
25634 31370
8027 24849
12312 23307
3731 32856
28725 29829
23424 44542
9950 43281
17138 22049
29393 31047
24061 46387
861 3924
12114 24868
29242 36744
5090 11267
3946 26100
7151 22151
27368 49971
43548 44917
25373 45846
4117 43120
24675 34139
9043 21081
29857 41278
37558 41510
11300 402...

output:

114
120
159
152
68
38
72
118
129
123
155
95
61
164
142
103
72
58
122
97
89
73
64
57
174
59
67
114
111
99
122
60
100
61
20
112
104
103
114
168
113
70
104
93
105
49
118
119
111
177
91
88
87
102
162
146
94
178
108
87
98
130
90
152
41
71
61
145
77
79
94
70
133
80
89
124
122
105
67
38
133
173
118
126
85
...

result:


Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #4:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%