QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#503777#4759. Artworkxiaowuc1AC ✓45ms11756kbC++172.2kb2024-08-04 01:07:462024-08-04 01:07:46

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

1
3
3
4
3

result:

ok 5 lines

Test #2:

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

input:

1 1 10000
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 10000 lines

Test #3:

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

input:

1 1000 10000
1 720 1 865
1 767 1 767
1 132 1 132
1 934 1 968
1 549 1 549
1 341 1 341
1 224 1 224
1 691 1 691
1 149 1 562
1 710 1 710
1 176 1 176
1 802 1 802
1 463 1 463
1 814 1 944
1 935 1 935
1 991 1 995
1 605 1 723
1 491 1 720
1 97 1 472
1 407 1 590
1 781 1 781
1 706 1 706
1 449 1 521
1 916 1 938
...

output:

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

result:

ok 10000 lines

Test #4:

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

input:

1000 1 10000
174 1 174 1
342 1 342 1
186 1 186 1
323 1 323 1
892 1 892 1
107 1 107 1
592 1 592 1
997 1 997 1
470 1 470 1
541 1 541 1
855 1 855 1
737 1 737 1
217 1 217 1
391 1 391 1
659 1 659 1
338 1 338 1
893 1 893 1
130 1 130 1
649 1 649 1
82 1 82 1
594 1 594 1
492 1 492 1
71 1 71 1
965 1 965 1
37 ...

output:

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

result:

ok 10000 lines

Test #5:

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

input:

300 700 10000
98 409 133 409
120 286 154 286
278 238 278 319
282 49 285 49
67 390 67 391
6 264 35 264
299 63 299 63
46 505 143 505
44 265 44 319
234 555 280 555
215 214 290 214
158 229 180 229
5 260 43 260
15 321 15 349
220 480 220 496
163 596 256 596
246 64 247 64
147 71 147 86
241 460 299 460
160 ...

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
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
10
10
10
10
10
13
13
1...

result:

ok 10000 lines

Test #6:

score: 0
Accepted
time: 10ms
memory: 10048kb

input:

700 300 10000
13 233 13 280
75 241 113 241
144 120 243 120
498 25 498 39
576 165 614 165
11 58 42 58
208 224 306 224
657 139 686 139
312 97 348 97
456 147 456 189
383 237 383 276
213 4 253 4
42 118 42 129
652 286 652 292
534 54 534 81
189 264 218 264
243 128 298 128
376 198 385 198
635 259 667 259
2...

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 10000 lines

Test #7:

score: 0
Accepted
time: 44ms
memory: 11608kb

input:

1000 1000 10000
460 359 460 359
263 17 263 17
484 611 484 611
464 834 464 834
103 281 103 281
351 377 351 377
544 89 544 89
216 698 216 698
490 145 490 145
692 888 692 888
374 940 374 940
928 693 928 693
636 521 636 521
740 147 740 147
911 833 911 833
351 980 351 980
356 589 356 589
857 21 857 21
75...

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 10000 lines

Test #8:

score: 0
Accepted
time: 40ms
memory: 11632kb

input:

1000 1000 10000
34 244 34 252
994 486 998 486
845 634 845 636
874 984 876 984
598 264 598 270
166 842 166 849
972 381 972 387
83 454 83 454
596 521 596 530
496 10 497 10
959 757 959 757
378 755 378 764
318 666 325 666
961 344 966 344
156 271 157 271
786 451 787 451
577 99 577 107
433 789 438 789
888...

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 10000 lines

Test #9:

score: 0
Accepted
time: 32ms
memory: 11608kb

input:

1000 1000 10000
417 661 485 661
873 504 873 507
24 759 34 759
930 307 977 307
742 436 757 436
310 824 310 863
502 751 539 751
28 726 28 752
324 441 388 441
289 170 289 258
832 930 864 930
508 695 508 772
609 844 704 844
244 85 244 108
335 215 335 245
639 352 639 429
594 5 673 5
971 602 974 602
443 4...

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 10000 lines

Test #10:

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

input:

1000 1000 10000
32 268 586 268
421 582 878 582
812 305 812 357
84 347 594 347
171 524 395 524
543 740 543 762
637 569 637 743
45 769 564 769
298 521 298 866
53 179 53 557
780 606 940 606
606 388 665 388
100 587 380 587
874 7 874 24
496 992 717 992
243 442 243 915
440 531 519 531
613 969 613 992
469 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
8
12
12
12
12
12
16
16
16
17
17
17
17
17
17
17
17
17
19
20
20
20
22
22
22
22
23
24
25
25
29
29
29
29
29
29
29
29
31
32
32
32
34
35
36
36
36
36
36
37
37
37
40
40
41
41
41
41
45
45
46
47
47
47
51
51
51
52
52
55
60
62
71
72
72
73
73
77
79
...

result:

ok 10000 lines

Test #11:

score: 0
Accepted
time: 45ms
memory: 11612kb

input:

1000 1000 10000
1 285 1000 285
1 887 1000 887
528 1 528 1000
176 1 176 1000
400 1 400 1000
1 807 1000 807
814 1 814 1000
890 1 890 1000
1 149 1000 149
1 963 1000 963
1 945 1000 945
1 913 1000 913
1 751 1000 751
1 571 1000 571
1 417 1000 417
610 1 610 1000
1 151 1000 151
234 1 234 1000
316 1 316 1000...

output:

2
3
6
9
12
16
20
24
30
36
42
48
54
60
66
77
84
96
108
120
130
140
154
165
176
187
198
216
234
247
260
273
294
315
336
352
374
396
418
440
462
484
506
528
550
575
600
624
648
675
700
728
756
784
812
840
868
896
928
960
990
1023
1056
1089
1122
1156
1190
1225
1260
1295
1330
1368
1406
1444
1482
1521
156...

result:

ok 10000 lines

Test #12:

score: 0
Accepted
time: 42ms
memory: 11756kb

input:

1000 1000 10000
130 322 898 322
283 492 814 492
72 470 789 470
67 700 713 700
362 608 918 608
124 258 846 258
37 992 640 992
20 692 953 692
17 528 970 528
6 378 575 378
4 242 974 242
62 100 977 100
4 756 972 756
66 612 702 612
133 280 866 280
21 946 745 946
157 562 822 562
261 632 986 632
9 994 963 ...

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 10000 lines

Test #13:

score: 0
Accepted
time: 32ms
memory: 11696kb

input:

1000 1000 10000
508 492 508 508
232 766 766 766
484 484 484 514
338 660 660 660
150 848 848 848
528 472 528 528
426 572 572 572
948 52 948 948
212 212 212 786
242 242 758 242
332 666 666 666
246 752 752 752
410 410 590 410
52 52 52 946
352 352 648 352
320 320 680 320
74 924 924 924
422 422 578 422
1...

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 10000 lines