QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#697398#1814. Kingdoms and QuarantineZ_301WA 1168ms23404kbC++144.5kb2024-11-01 13:53:522024-11-01 13:53:52

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 20176kb

input:

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

output:

3
4 1 2 

result:

ok accepted

Test #2:

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

input:

1 2 2
1 2
1 3

output:

0


result:

ok accepted

Test #3:

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

input:

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

output:

5
1 7 6 2 4 

result:

ok accepted

Test #4:

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

input:

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

output:

11
10 9 14 13 20 11 1 18 16 5 6 

result:

ok accepted

Test #5:

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

input:

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

output:

21
27 20 22 19 24 16 17 8 6 2 13 18 11 9 28 25 3 26 1 4 15 

result:

ok accepted

Test #6:

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

input:

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

output:

22
2 50 44 21 23 36 48 22 41 32 17 6 42 15 35 24 26 45 12 33 11 8 

result:

ok accepted

Test #7:

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

input:

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

output:

10
40 17 55 38 67 85 44 97 99 47 

result:

ok accepted

Test #8:

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

input:

60 60 200
40 91
35 64
3 105
48 110
4 115
36 77
2 104
14 111
43 68
23 112
37 62
40 68
57 106
22 95
9 89
29 69
24 101
52 75
26 63
60 115
50 118
26 93
30 73
38 116
54 97
55 76
10 97
8 82
1 74
29 89
27 72
33 102
7 86
51 77
4 63
40 109
6 97
1 120
39 102
53 89
2 78
35 109
22 107
47 89
44 106
44 105
46 120...

output:

101
133 163 69 193 187 49 22 174 119 149 64 83 117 140 41 95 67 185 5 74 38 14 35 90 77 132 189 124 142 151 115 162 15 198 44 137 61 51 154 134 71 146 82 158 96 9 48 72 200 144 135 63 12 33 29 99 148 178 59 36 105 76 167 56 130 195 19 68 112 180 26 23 102 164 3 91 1 42 109 150 184 53 94 125 97 186 3...

result:

ok accepted

Test #9:

score: 0
Accepted
time: 5ms
memory: 20212kb

input:

60 60 500
17 63
3 65
31 120
58 94
36 76
14 120
54 96
30 97
43 119
53 67
41 75
59 84
49 70
11 81
27 70
2 105
44 94
13 115
16 97
3 95
19 83
2 89
29 119
16 77
26 99
25 115
25 93
43 84
43 61
45 105
38 69
24 100
16 118
33 73
6 101
17 67
10 84
49 73
45 118
48 92
22 93
1 111
8 72
19 107
23 95
1 112
21 108
...

output:

319
444 271 301 279 484 191 174 421 129 448 488 120 418 496 337 282 474 393 86 394 413 345 331 220 479 439 194 36 308 450 349 130 281 392 414 196 339 297 427 208 313 229 195 384 445 257 483 409 373 267 333 110 319 476 401 52 41 67 207 399 312 433 121 221 457 233 59 160 440 128 97 359 304 261 407 408...

result:

ok accepted

Test #10:

score: 0
Accepted
time: 8ms
memory: 20524kb

input:

60 60 1000
60 94
5 71
53 115
22 61
8 65
38 62
51 63
26 68
40 94
16 63
24 100
54 98
28 86
41 96
47 101
42 75
56 100
29 89
1 110
23 71
60 73
36 74
12 95
3 106
18 77
4 65
49 83
3 83
26 117
24 103
59 85
36 63
8 96
8 101
26 114
37 69
24 89
19 80
36 100
54 89
22 75
3 89
31 119
33 62
58 69
38 114
39 81
54 ...

output:

691
895 720 995 919 408 987 554 233 717 745 656 623 54 793 317 564 545 373 971 727 137 503 491 850 508 871 679 439 259 616 375 611 369 779 440 267 511 447 221 484 476 814 757 649 530 819 172 297 217 482 63 536 687 708 930 418 273 459 933 102 180 453 89 331 367 588 279 729 816 563 624 309 354 479 266...

result:

ok accepted

Test #11:

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

input:

60 60 2000
40 120
9 78
35 69
18 102
19 117
22 84
4 72
53 68
49 73
16 107
50 93
16 80
35 72
31 112
9 67
47 97
35 65
14 96
49 111
48 117
55 104
43 97
17 74
9 76
45 114
38 117
18 112
11 114
58 72
3 116
32 95
38 113
10 104
17 93
36 94
16 106
17 84
43 61
46 61
20 62
22 72
18 73
3 118
22 70
44 68
34 75
47...

output:

1282
1960 405 1444 1711 1097 504 419 603 302 497 375 194 308 641 414 28 589 1630 1155 323 568 830 819 193 904 387 654 711 537 676 256 291 370 969 500 38 772 438 669 429 542 493 430 87 780 1001 377 648 996 79 300 458 530 615 1892 627 666 786 521 447 455 1300 539 761 787 1195 371 466 1346 1289 567 464...

result:

ok accepted

Test #12:

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

input:

60 60 2000
53 65
55 77
46 75
31 82
12 72
49 100
46 105
20 80
5 90
31 77
54 76
37 84
38 68
14 70
47 93
10 120
57 94
54 107
53 74
37 120
9 96
23 84
18 83
31 69
57 82
11 67
52 65
9 88
5 65
51 90
19 96
56 117
29 89
24 83
13 82
26 76
51 73
23 86
52 108
12 71
26 62
51 100
41 100
5 66
56 75
10 87
16 72
47 ...

output:

1232
1771 1006 1882 1325 1231 929 492 1008 1921 1809 199 138 552 500 794 339 864 661 106 841 395 647 602 697 1240 279 650 851 1001 895 165 236 599 511 491 282 525 1093 601 899 844 653 1167 1023 510 161 1040 1284 742 586 785 417 667 362 705 641 771 301 538 618 1321 1009 911 598 315 461 234 374 905 27...

result:

ok accepted

Test #13:

score: 0
Accepted
time: 9ms
memory: 21708kb

input:

60 60 2000
10 119
13 117
49 102
26 106
20 76
54 73
9 72
42 100
19 118
51 68
30 64
21 95
9 84
18 90
51 91
39 109
49 112
7 79
13 82
5 95
20 65
5 105
38 91
35 118
46 89
36 63
41 91
23 101
50 110
39 92
60 104
47 74
50 97
6 72
7 76
1 119
17 70
51 84
23 97
28 84
42 82
59 75
32 86
53 69
3 61
43 92
35 85
56...

output:

1578
1622 315 1862 1596 1163 159 1249 1245 741 632 524 427 701 285 144 928 341 703 488 475 615 642 679 436 272 767 512 731 930 907 377 1123 981 826 509 90 189 793 268 78 345 438 1120 761 723 927 1036 665 574 431 392 556 649 869 700 661 931 895 861 748 502 212 1175 545 827 209 1090 486 770 908 549 55...

result:

ok accepted

Test #14:

score: 0
Accepted
time: 8ms
memory: 20412kb

input:

60 60 3000
57 75
4 75
40 61
9 120
55 88
31 107
47 77
56 92
49 100
30 92
34 72
29 105
46 63
37 80
22 65
11 72
43 111
24 88
6 81
24 94
47 98
2 79
59 84
51 64
13 73
30 63
58 69
25 65
52 97
36 106
26 97
16 103
16 92
31 112
36 108
13 97
32 119
39 114
48 117
25 66
14 117
6 90
53 84
1 117
58 108
25 99
12 1...

output:

2810
2974 291 2937 2886 82 370 1445 510 391 139 2905 2995 361 901 967 3 114 360 446 172 274 113 523 16 104 325 532 321 408 614 215 436 138 830 643 309 412 582 346 861 427 305 444 508 226 694 171 448 79 106 389 91 404 178 1053 777 1108 1005 514 64 152 192 533 627 292 632 191 954 239 774 65 347 198 22...

result:

ok accepted

Test #15:

score: 0
Accepted
time: 12ms
memory: 22200kb

input:

60 60 3000
47 106
32 101
35 118
6 104
34 111
16 78
29 112
48 96
32 114
41 70
21 80
16 75
42 80
9 90
26 88
15 95
13 105
27 110
53 102
43 83
35 94
26 67
10 92
48 69
53 120
54 90
58 69
9 66
50 109
53 106
39 84
39 89
17 116
33 77
30 84
27 89
41 87
35 89
16 109
26 90
37 91
4 103
9 76
32 102
29 61
58 115
...

output:

2608
2973 596 2977 2924 636 296 501 751 534 472 2940 2963 546 260 907 635 492 600 705 853 1412 255 179 70 1394 475 967 389 69 975 652 838 209 259 1222 352 597 275 583 424 614 314 704 569 315 319 419 386 1143 527 1244 578 1380 532 477 171 12 654 922 816 405 620 173 457 503 605 989 528 17 1186 647 823...

result:

ok accepted

Test #16:

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

input:

60 60 3000
30 116
60 66
30 87
8 84
6 61
58 96
26 89
60 86
15 91
7 89
13 104
56 104
33 105
37 72
2 88
8 107
56 65
29 77
15 103
3 115
18 67
52 65
40 71
38 98
36 85
18 102
59 86
26 101
24 67
2 71
56 69
55 72
57 79
32 65
12 114
36 81
55 97
41 113
15 89
7 84
59 113
53 71
57 99
44 99
4 101
36 68
13 78
7 1...

output:

2746
2900 464 223 614 2560 2989 293 591 401 465 368 466 945 173 436 947 450 119 685 665 318 175 182 415 420 621 573 687 1434 1407 435 828 722 47 218 296 967 331 387 604 1014 724 487 214 878 458 1312 55 577 1130 67 313 727 273 556 479 252 423 822 952 362 561 632 472 580 675 72 668 809 539 253 673 744...

result:

ok accepted

Test #17:

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

input:

60 60 3000
32 72
16 110
13 102
52 65
36 79
39 118
16 64
46 108
56 116
10 109
35 117
28 90
31 83
36 78
14 77
6 104
4 64
5 73
34 63
21 66
56 61
26 64
37 106
53 92
2 91
35 102
40 99
57 95
40 79
53 104
20 72
60 118
41 112
60 106
2 101
60 113
50 87
31 102
46 88
44 98
18 101
34 87
52 63
52 86
56 85
8 99
5...

output:

1946
2973 1251 2810 2119 1748 524 833 802 214 912 607 988 1969 1377 1438 778 760 1592 1291 943 2096 1114 849 1434 414 557 770 1835 558 1159 975 1855 930 847 276 572 1303 1012 545 932 995 916 775 1452 905 868 902 1455 835 344 820 763 1210 713 1090 538 948 821 1602 2160 1881 1182 1313 918 1045 439 590...

result:

ok accepted

Test #18:

score: 0
Accepted
time: 7ms
memory: 23404kb

input:

60 60 3000
13 110
32 77
31 63
23 75
28 119
16 84
32 113
50 114
15 66
47 96
21 97
41 81
55 88
25 110
59 112
1 100
45 115
27 66
24 66
38 94
40 67
39 95
6 109
30 75
3 117
43 111
28 118
37 101
57 66
58 90
57 79
47 69
13 87
6 115
57 101
54 88
14 78
22 68
53 78
58 73
10 74
40 94
43 107
34 93
19 85
44 86
5...

output:

2770
2862 5 2827 2996 86 159 600 439 95 211 372 357 693 335 140 522 963 267 576 495 2939 2978 334 754 199 292 296 392 229 503 812 525 859 549 544 628 662 1087 636 793 376 298 429 391 470 417 170 286 857 974 535 34 367 113 266 401 698 6 428 382 126 467 218 563 441 261 399 313 516 249 343 521 136 171 ...

result:

ok accepted

Test #19:

score: 0
Accepted
time: 5ms
memory: 20244kb

input:

80 80 200
32 95
60 86
23 146
79 154
7 81
66 81
56 96
74 100
20 120
54 157
48 148
69 144
60 87
74 87
3 141
60 150
48 125
39 129
37 82
4 81
19 95
30 132
62 136
67 118
77 119
79 129
51 119
51 152
72 114
34 110
27 84
40 112
24 123
32 133
28 131
34 102
75 102
5 93
30 135
39 131
4 160
24 107
49 148
75 149...

output:

106
196 141 58 114 150 19 156 167 138 155 47 151 80 5 82 6 72 108 172 26 171 174 121 53 9 61 43 165 92 96 149 38 123 63 187 18 37 36 144 44 132 85 143 181 134 197 31 131 50 35 195 137 75 102 55 1 7 98 148 78 158 152 21 169 100 133 105 113 30 136 41 128 48 170 164 42 33 142 124 84 17 60 153 52 49 199...

result:

ok accepted

Test #20:

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

input:

80 80 1000
25 148
12 123
32 124
64 137
45 81
30 114
3 135
13 142
50 130
23 113
42 146
64 139
66 148
5 136
62 86
19 137
57 128
1 90
56 103
38 155
43 84
3 88
62 130
12 87
15 107
27 117
6 135
17 132
54 149
53 109
5 121
17 93
6 132
50 133
62 94
20 88
6 143
44 148
33 131
61 118
68 149
57 141
46 159
55 15...

output:

806
916 938 983 975 692 575 625 387 580 542 658 682 675 293 264 611 834 315 911 381 645 206 959 946 628 701 240 375 310 705 753 570 589 400 707 291 738 301 466 852 115 93 790 616 795 507 481 683 555 18 730 872 340 362 317 693 724 957 822 877 860 392 150 528 333 441 812 339 142 485 377 554 524 775 93...

result:

ok accepted

Test #21:

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

input:

80 80 2000
53 123
41 154
25 132
32 137
40 149
78 99
2 105
11 110
30 91
26 129
41 110
75 131
62 98
15 87
6 144
35 103
16 136
69 134
56 146
78 159
2 155
15 140
24 134
34 113
61 88
22 131
73 156
46 116
68 113
48 115
28 92
22 93
53 156
56 149
27 104
56 91
25 140
52 87
50 129
48 91
58 127
15 125
12 111
1...

output:

1496
1449 463 1979 1845 103 221 145 577 19 344 904 223 193 300 465 578 264 341 268 117 446 431 284 584 786 990 840 482 479 292 54 1179 701 776 1106 251 1463 940 621 14 914 611 1648 956 87 788 944 550 585 457 432 1299 246 794 452 801 461 874 409 290 442 1578 1640 680 810 783 1067 902 876 949 798 852 ...

result:

ok accepted

Test #22:

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

input:

80 80 2000
7 97
42 84
29 152
46 115
34 111
50 121
34 153
62 150
63 138
14 154
27 134
34 116
20 90
37 143
66 149
62 102
10 160
43 110
37 152
29 112
5 99
68 139
55 122
74 135
43 113
71 159
5 131
37 106
70 118
3 124
2 87
35 130
74 99
70 134
44 143
55 134
26 81
10 133
47 130
24 92
77 108
13 133
56 87
39...

output:

1404
1997 1284 1744 1071 1785 909 1553 1669 1354 1230 725 1718 1256 1267 1572 1742 1341 1431 1712 1076 1406 1472 1084 1573 1469 1134 1681 1942 1567 1245 1556 1385 1564 1372 1512 1702 1474 915 780 1484 1825 1280 1722 1902 1732 1278 1928 746 1820 1159 736 1396 1684 1466 1822 962 1956 1471 1834 1141 19...

result:

ok accepted

Test #23:

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

input:

80 80 2000
75 99
6 84
42 111
54 127
12 116
42 113
18 114
22 131
70 139
29 83
5 98
50 83
77 104
20 132
24 100
55 132
54 151
52 110
61 128
44 127
74 105
58 160
61 104
42 93
80 160
54 98
48 103
11 87
38 152
29 103
18 135
72 160
77 154
1 116
6 134
2 112
37 134
13 154
51 157
75 114
77 131
9 139
12 106
34...

output:

1638
1862 541 1867 1802 1248 359 158 447 407 461 570 705 531 105 459 182 560 1437 669 848 1263 319 1159 701 434 587 930 398 1553 517 763 303 1747 1333 617 420 471 1185 110 896 1335 839 722 323 1277 654 1078 124 1377 707 1024 1106 894 327 794 495 699 924 788 620 984 159 1097 1135 1184 961 718 678 136...

result:

ok accepted

Test #24:

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

input:

80 80 3000
11 116
24 95
4 152
51 137
12 102
44 128
69 120
69 134
39 122
17 94
51 102
61 144
52 84
57 81
32 117
55 125
9 136
13 127
31 120
26 87
58 141
73 157
28 153
26 106
63 82
63 151
45 107
16 115
38 87
5 115
14 151
2 156
79 152
33 104
26 107
33 123
2 152
79 83
23 131
67 154
34 159
29 110
20 152
1...

output:

2518
2502 386 2279 2858 1125 248 355 1040 309 205 1605 219 583 478 687 419 252 210 1627 396 803 333 514 567 544 415 277 733 440 584 578 286 441 1293 672 269 148 140 768 392 243 214 1161 146 407 292 880 1123 455 821 448 1141 485 316 1335 889 610 283 693 442 662 722 275 663 2795 2927 318 334 229 203 5...

result:

ok accepted

Test #25:

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

input:

80 80 3000
53 81
62 95
69 96
5 110
41 101
18 123
55 110
51 148
36 117
55 108
72 130
9 152
26 147
38 100
30 155
19 155
50 91
15 100
74 110
33 146
41 154
46 113
37 91
43 133
56 137
66 131
39 114
10 107
11 99
47 133
64 91
30 120
13 156
17 94
7 82
50 85
45 108
24 115
73 90
18 107
34 97
27 147
58 91
78 1...

output:

2715
2986 415 2915 2893 537 1369 359 820 1159 533 581 8 1101 588 1112 984 643 698 664 331 425 1074 650 1384 823 843 1018 546 544 1077 803 516 336 682 933 190 648 280 321 510 1342 1400 285 1032 717 278 539 666 829 478 39 609 969 204 186 201 493 290 833 259 1046 1380 346 1061 798 910 982 1181 357 420 ...

result:

ok accepted

Test #26:

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

input:

80 80 3000
74 117
47 82
50 131
13 156
58 101
29 157
56 151
75 87
11 135
78 82
71 151
16 157
68 102
26 159
45 130
70 122
68 123
11 91
42 142
59 125
52 141
9 105
33 110
74 140
21 83
29 130
20 104
61 156
1 94
9 102
40 97
57 90
44 104
67 120
12 144
36 116
55 114
77 155
60 110
60 93
36 151
37 137
22 155
...

output:

2355
2769 1022 2950 2871 764 1250 472 917 1350 937 1951 1315 1297 832 1051 979 745 944 746 2236 1379 1583 1644 601 2090 529 564 568 822 1303 1064 1293 1248 1507 1931 1331 1167 2052 939 1135 1130 1062 1691 592 1085 1406 517 796 2009 731 1963 1311 874 576 1207 653 1308 997 1116 545 981 982 1212 831 15...

result:

ok accepted

Test #27:

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

input:

80 80 3000
29 138
41 120
64 108
62 95
71 147
45 110
37 154
71 82
49 84
55 82
18 81
1 141
41 139
78 130
3 135
65 134
48 102
25 81
17 121
21 83
10 125
49 104
63 144
14 111
64 130
23 87
13 97
72 100
36 97
37 100
46 110
59 82
7 86
73 157
77 98
75 122
15 108
27 106
18 149
54 133
48 106
63 86
58 150
13 13...

output:

2524
2685 647 2973 2821 351 1059 547 829 1622 475 544 912 883 563 1089 307 840 1049 778 1411 517 863 1399 509 673 1006 1195 1931 991 937 708 628 352 1009 286 746 936 1041 1016 1272 1534 1265 776 1822 1597 908 530 875 1466 1348 11 695 704 1730 1698 1203 952 1213 617 516 954 1068 1101 1143 154 356 126...

result:

ok accepted

Test #28:

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

input:

80 80 3000
77 151
47 107
20 102
48 160
69 104
16 155
52 154
64 118
70 132
30 141
66 132
36 100
66 109
12 147
33 145
48 142
72 149
44 154
29 117
60 127
63 118
21 115
61 150
50 131
12 148
39 108
8 155
62 153
6 87
80 130
27 153
33 128
18 150
80 121
62 95
8 96
39 151
26 123
23 120
35 124
31 113
54 100
1...

output:

1998
2949 815 2717 2875 737 360 802 240 1217 1318 662 718 1288 1503 2763 2979 375 1723 982 208 900 916 1495 565 892 273 708 123 1474 969 589 525 129 728 551 1093 1307 814 329 1398 988 1908 786 1177 271 1357 79 984 581 686 170 867 1026 369 500 639 1216 1111 646 1407 630 889 1290 1699 826 1008 1202 17...

result:

ok accepted

Test #29:

score: 0
Accepted
time: 376ms
memory: 21328kb

input:

1000 1000 3000
42 1981
990 1593
249 1397
568 1481
729 1994
719 1296
178 1959
177 1008
585 1063
612 1102
888 1378
888 1789
883 1380
978 1981
113 1754
253 1953
902 1262
518 1588
806 1449
489 1271
368 1026
317 1123
2 1988
962 1227
336 1880
927 1703
414 1043
402 1032
766 1538
226 1736
799 1879
813 1143
...

output:

1578
854 2765 2164 947 2232 2682 1880 244 860 2714 1551 2641 850 2275 2984 1460 175 2896 1767 1671 1913 690 1246 451 815 2825 2504 1587 2694 2033 904 1815 1517 1175 2933 2673 2134 1506 2453 2007 2271 2457 1909 1074 323 1963 2906 1633 1871 849 2370 2672 2919 2978 1316 2637 2254 653 2162 2308 2723 152...

result:

ok accepted

Test #30:

score: 0
Accepted
time: 380ms
memory: 22596kb

input:

1000 1000 3000
912 1168
247 1188
798 1560
618 1138
611 1467
268 1411
302 1117
885 1023
934 1777
732 1717
827 1421
855 1063
928 1047
135 1603
59 1730
307 1539
681 1044
413 1011
44 1689
328 1891
101 1678
334 1171
931 1500
577 1793
556 1714
346 1748
628 1949
417 1736
59 1356
401 1783
67 1571
924 1064
1...

output:

1594
2499 801 945 2433 2853 941 2602 959 2194 2702 309 447 2369 1940 302 112 2916 2609 2188 2435 1572 1716 556 150 2532 1528 583 2472 981 659 1350 283 2486 2386 2425 2991 2865 1775 1365 2106 2294 2881 1648 1124 2863 537 158 2180 2904 810 2678 795 730 2819 2014 2506 370 2914 1881 2122 845 1370 2318 2...

result:

ok accepted

Test #31:

score: 0
Accepted
time: 359ms
memory: 20688kb

input:

1000 1000 3000
330 1699
664 1166
556 1642
273 1288
354 1795
435 1525
157 1163
200 1501
922 1144
264 1052
823 1819
998 1773
822 1869
268 1204
415 1681
355 1775
260 1214
567 1086
204 1099
509 1738
330 1147
382 1138
924 1961
221 1213
834 1739
895 1196
864 1342
174 1933
153 1175
343 1461
232 1836
811 11...

output:

1655
725 475 2983 1831 2689 1385 147 529 2796 1156 486 1660 1812 2481 2690 506 1512 776 2839 670 2733 1873 1176 604 1732 215 2755 2938 967 1726 4 1155 2866 2730 2890 1788 416 921 2672 794 2671 2428 2403 277 1846 2805 2937 2663 2531 2911 2327 2897 950 2360 2836 2141 1648 2904 458 1479 2928 1802 1139 ...

result:

ok accepted

Test #32:

score: 0
Accepted
time: 573ms
memory: 23384kb

input:

1500 1500 3000
1341 1517
832 1618
1031 1651
1128 1677
206 1889
347 2836
225 2772
1198 1733
1307 1884
84 1870
425 2658
162 2097
467 2062
1406 2565
1143 1980
1335 2339
822 2100
310 1792
291 2224
1276 2244
1382 1532
50 1510
1010 2756
427 2992
1387 2727
812 1916
1007 2328
1480 2107
1337 2117
634 2621
60...

output:

1404
620 1356 1752 2248 2431 2174 390 1044 2738 2048 400 632 1451 1685 703 980 656 2752 216 1935 1785 1252 2300 1958 1856 2258 1425 100 2478 1196 1926 2445 2280 1959 1271 1155 2944 1392 1788 1834 2824 1947 1583 1495 2039 2698 1071 22 2930 2564 204 718 2175 84 2113 1800 2143 406 2910 1471 2725 1534 3...

result:

ok accepted

Test #33:

score: 0
Accepted
time: 565ms
memory: 22024kb

input:

1500 1500 3000
963 1846
402 2056
303 1852
588 2296
151 2990
226 2196
648 2054
1379 2292
1380 2920
476 2550
515 2519
573 1666
606 2770
180 2089
966 1885
565 2598
1041 1749
227 2525
1250 2576
135 2488
882 1767
63 2446
1054 2867
346 2742
601 1811
156 2279
828 2261
164 2318
1215 1806
989 1547
688 2798
1...

output:

1424
2780 2959 2764 667 2166 1251 1071 1505 1993 1216 303 956 2948 607 1419 788 1922 1417 2298 2102 555 2889 2914 235 1308 162 2582 1527 2600 1541 2498 717 1140 44 724 2566 1712 2268 2411 2406 1088 545 1455 2188 75 1367 2332 365 1967 566 2975 2389 2512 360 411 1077 121 4 1100 529 815 2098 2074 959 2...

result:

ok accepted

Test #34:

score: 0
Accepted
time: 569ms
memory: 21548kb

input:

1500 1500 3000
1096 1885
448 2108
894 1764
709 1632
61 2276
1076 2084
1027 1782
1486 1725
616 1836
799 1947
1022 2781
1316 2373
642 1660
1430 2784
68 2181
1224 2665
1450 2212
563 2852
81 1596
462 2169
770 2219
1197 2031
657 2366
616 2170
1091 1783
1130 1968
312 1958
671 2599
465 2683
1144 1773
1344 ...

output:

1449
1354 192 1602 473 2232 688 1451 2637 2967 282 2356 614 1579 1339 2866 544 266 2422 2114 1681 814 2507 2358 1457 2999 1920 2297 731 2497 1110 1250 953 1122 275 2504 2600 2549 802 2794 2350 896 938 2501 1490 701 1007 1049 1310 1558 1071 928 2219 1388 2217 2047 2240 1442 1109 805 454 2448 2708 276...

result:

ok accepted

Test #35:

score: 0
Accepted
time: 1168ms
memory: 21440kb

input:

3000 3000 3000
2456 3024
1202 5160
2592 4208
2830 4943
1279 5401
1554 5363
1051 3868
2353 4169
715 3495
2991 3962
903 3817
499 3427
1514 3738
805 3993
1681 4194
1999 3705
2935 5180
14 5270
420 3900
1857 5035
2587 3131
357 5790
2123 5059
2085 3573
2656 4794
1319 5107
971 5854
2212 4142
1452 3062
2907...

output:

1312
264 1868 2620 849 1350 92 1129 1299 246 1041 1489 313 2752 1687 2397 535 2008 2686 1169 113 1482 2651 1796 2409 307 1950 2130 1655 314 2153 1454 675 864 2073 918 2950 2363 1861 217 947 934 2663 1275 2060 620 60 432 1538 1867 2255 765 420 1246 573 291 303 471 1255 2938 1768 1722 1952 1455 1181 2...

result:

ok accepted

Test #36:

score: 0
Accepted
time: 1161ms
memory: 22396kb

input:

3000 3000 3000
1225 3659
1285 5562
456 4991
234 5043
2878 5234
574 3408
283 5144
2343 4635
620 3335
868 5368
583 4477
168 5058
2245 3361
292 5035
2635 5228
745 5426
1136 4128
1383 3242
387 3091
792 5561
859 4534
97 3979
309 3385
2706 5354
2476 4940
2664 3304
1874 4625
197 5659
2253 3502
2034 5653
17...

output:

1328
823 476 951 775 323 2530 2324 1780 2445 689 2190 2858 2204 1708 482 2486 851 302 2583 1922 1808 2456 2011 144 2432 219 1086 2503 2806 1429 968 2272 2928 821 2062 1484 1449 22 1848 1489 1432 928 1980 2760 2126 196 1110 167 2203 2654 2177 342 2653 2826 1715 1042 1604 2795 671 2111 2597 1183 2841 ...

result:

ok accepted

Test #37:

score: 0
Accepted
time: 1128ms
memory: 22912kb

input:

3000 3000 3000
271 3216
919 3270
2084 3946
1699 3741
1761 5849
2381 3271
18 4257
858 3256
1250 4068
1291 3452
701 5072
2433 5871
173 4675
667 3842
25 4434
1289 4855
803 4656
19 4119
2904 5305
840 4229
1623 4731
448 3748
2983 5773
173 5976
736 4127
2544 4618
1853 4626
10 5952
1633 5075
234 4686
2646 ...

output:

1334
2224 2463 967 2228 2747 1737 2134 1963 1216 1725 841 7 15 182 2882 2356 1789 553 1346 1924 2372 1363 2199 765 1949 1074 1489 653 338 302 1546 399 2299 222 480 1131 2843 792 152 2017 962 900 472 2571 581 482 1500 2577 1617 58 266 1053 514 525 1984 2084 1741 2542 1215 2337 146 2421 2254 674 1802 ...

result:

ok accepted

Test #38:

score: 0
Accepted
time: 1139ms
memory: 22872kb

input:

3000 3000 3000
1240 5393
448 3778
1526 5830
1069 4379
2113 5862
2197 3795
2060 5414
1389 5745
2001 4663
2058 3176
2620 4112
2317 5026
2291 5281
1835 5049
229 4896
1359 3573
78 3136
164 5183
515 4637
1256 4807
1810 3313
952 4561
1967 4231
2056 5900
2316 5234
2860 5322
1347 3002
371 5623
2341 4439
69 ...

output:

1264
2703 1390 631 2728 268 133 2697 266 995 1541 2080 2533 2484 303 1359 409 2933 447 537 1033 1693 1164 773 2275 1519 145 2595 585 1266 120 2034 855 1007 1144 2542 1670 30 2731 371 1110 2056 1019 540 853 910 2889 2009 905 1543 1902 2345 2837 2780 2017 305 115 457 1567 1760 805 2527 2721 2985 1059 ...

result:

ok accepted

Test #39:

score: 0
Accepted
time: 1146ms
memory: 22284kb

input:

3000 3000 3000
2732 3825
1144 3457
2386 4614
324 3425
2126 4021
2074 3415
2793 3761
233 5169
2564 3807
1810 3200
1068 3668
1932 4718
2280 5699
2834 3937
2436 3949
1827 4285
252 3913
1492 3209
1103 4839
2432 3368
255 4553
473 4799
104 5606
1554 4561
425 4997
2573 4572
696 5263
71 3872
2980 5845
222 3...

output:

1284
2325 101 1678 1600 49 1500 2009 2097 1202 1402 304 2174 1160 1707 2054 2545 2842 1347 1175 46 2115 165 2541 317 1429 1674 702 1327 511 2177 2410 130 2592 2441 2463 1221 1677 1993 2751 1092 525 2420 1773 362 2312 1445 1815 1196 131 643 2339 1238 2604 45 204 2135 1353 1306 1631 663 438 1756 2907 ...

result:

ok accepted

Test #40:

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

input:

80 80 3000
60 158
24 126
41 116
41 130
65 113
22 85
62 93
25 94
4 102
42 144
48 104
37 83
31 134
30 127
26 82
4 153
32 146
72 141
76 106
27 108
21 154
10 126
57 133
59 83
18 104
61 133
20 125
24 108
31 127
51 132
58 152
37 94
41 105
59 126
5 135
59 156
1 156
28 84
2 152
65 137
5 81
7 118
7 121
56 14...

output:

2595
2694 686 2898 2676 280 601 426 368 697 4 541 478 699 644 704 105 417 975 1036 473 967 1203 56 752 472 583 1096 524 1060 552 306 579 259 1055 1121 257 107 1077 520 1343 425 1382 690 464 851 228 598 218 683 1128 1178 110 545 1430 852 227 862 1556 171 1191 261 864 295 358 505 817 605 289 563 412 1...

result:

ok accepted

Test #41:

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

input:

80 80 3000
76 153
16 113
46 144
40 122
19 160
6 113
7 89
78 137
35 147
60 135
70 98
60 150
50 96
59 151
73 116
37 133
31 95
34 154
50 107
40 141
79 159
38 82
70 86
2 140
6 147
71 124
4 136
71 120
72 151
33 155
21 83
62 130
19 118
55 160
40 149
79 132
40 130
80 87
33 157
58 95
4 102
61 115
65 124
63 ...

output:

2690
2972 362 2839 2602 2938 2413 837 370 846 1031 264 915 920 126 587 1060 345 640 408 337 441 304 749 1761 849 384 407 563 642 636 447 1359 854 509 445 644 1018 1132 845 1101 353 1170 989 1803 773 1774 597 182 545 1223 539 369 1109 964 758 1151 1741 1067 959 1616 654 877 235 472 205 941 422 890 83...

result:

ok accepted

Test #42:

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

input:

80 80 3000
18 90
65 104
65 136
43 145
37 119
79 102
62 136
15 149
28 102
47 109
40 83
49 145
9 86
22 156
57 145
56 135
19 121
38 133
67 150
14 153
4 116
23 149
31 155
72 82
5 90
35 93
1 114
1 113
9 98
77 93
66 155
13 114
10 134
30 137
63 131
74 119
20 136
32 96
67 143
24 125
36 137
29 92
30 94
19 13...

output:

2404
2978 2072 2860 2887 906 1725 2321 1797 1295 1623 2447 1217 846 1568 1628 853 1574 1343 901 785 1479 1111 2291 1888 1213 1634 284 1004 979 1867 993 278 1079 2014 2293 815 969 1535 697 596 515 1718 1163 1301 1160 604 1503 1255 1234 820 2082 1915 1225 747 1597 1883 1435 962 610 847 1671 1857 401 1...

result:

ok accepted

Test #43:

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

input:

100 100 3000
61 192
7 198
67 187
100 171
74 109
84 124
100 117
42 186
45 122
2 186
57 181
49 117
48 179
11 142
21 163
52 189
85 170
39 195
73 198
28 192
12 168
97 170
5 127
41 149
89 124
74 144
91 105
52 173
19 139
12 160
12 149
34 198
29 145
30 157
89 180
33 165
23 105
21 181
82 184
49 122
10 189
8...

output:

2812
2923 695 2910 2902 1142 689 764 427 1623 1478 304 948 758 514 671 342 690 1183 1026 626 720 789 820 1238 502 885 435 222 161 726 560 51 407 836 727 488 1316 680 837 478 339 338 406 32 438 963 349 28 1062 519 201 759 399 840 158 481 1108 644 570 525 532 696 1237 393 474 600 360 1091 2959 2543 89...

result:

ok accepted

Test #44:

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

input:

100 100 3000
78 108
74 150
3 158
55 121
1 106
3 138
97 140
53 176
51 105
55 140
73 169
93 145
10 174
61 127
59 194
57 143
12 179
25 129
27 137
24 178
21 188
66 151
74 184
64 154
83 117
22 125
52 164
1 175
51 142
54 177
89 127
62 173
63 145
81 102
21 147
96 111
26 166
80 101
69 183
15 152
53 130
1 13...

output:

2553
2982 939 2807 2745 410 947 438 304 441 327 400 1121 456 560 1094 1439 1015 477 1711 1014 460 1032 537 984 1304 619 397 695 753 266 751 944 290 965 1897 2929 41 526 911 1156 472 1203 995 761 183 1247 489 1035 1438 914 558 592 1296 333 861 1311 1607 729 1363 350 783 660 820 7 1345 301 1687 459 88...

result:

ok accepted

Test #45:

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

input:

100 100 3000
48 150
49 127
42 138
24 150
67 141
87 126
45 118
20 145
98 118
52 176
8 150
19 131
40 142
13 108
17 140
9 174
24 170
5 193
53 172
15 122
10 110
86 195
56 174
35 164
46 199
68 155
84 188
53 163
88 122
82 139
83 102
5 197
78 153
57 191
61 187
50 142
30 156
97 156
42 107
24 189
96 122
1 14...

output:

2451
2999 1627 2760 2917 793 1647 111 1103 981 924 1020 606 1060 307 838 603 1129 2368 1218 649 76 2044 1097 1311 1348 636 344 570 1631 1373 374 1521 797 900 882 754 1507 1848 778 768 1419 545 1190 830 1147 679 939 916 665 2085 1739 1420 403 278 1340 544 995 1246 908 1151 713 290 577 1911 929 627 95...

result:

ok accepted

Test #46:

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

input:

500 500 3000
90 523
474 549
108 835
20 597
167 707
274 585
345 665
456 601
114 757
195 727
126 843
300 941
346 814
298 699
36 510
169 801
129 664
135 840
192 734
412 958
247 531
66 892
261 920
230 789
108 584
170 965
351 764
191 643
150 894
173 979
97 884
1 707
108 772
282 817
263 782
365 537
444 52...

output:

2990
2763 1471 2610 2669 1886 2884 2774 1900 2468 2895 2333 2983 2843 2658 2597 2371 2936 2897 2147 2475 2320 1336 2144 2087 1350 1618 2902 2864 2016 2495 2609 2250 1864 2803 2531 2055 2492 2869 2108 2940 2896 2807 2859 2564 396 2162 2209 2070 2939 2624 2907 2851 1941 2696 2686 2985 2698 850 2276 27...

result:

ok accepted

Test #47:

score: 0
Accepted
time: 62ms
memory: 21732kb

input:

500 500 3000
457 981
496 955
394 548
362 673
103 659
303 981
39 523
173 664
346 540
396 735
351 847
185 681
440 752
131 586
447 608
98 853
280 515
198 579
162 575
308 640
449 533
471 705
128 655
355 546
495 982
158 657
410 657
38 833
116 784
212 718
184 688
22 685
42 916
410 738
465 554
312 712
456 ...

output:

2796
390 107 1186 111 2361 1478 1244 2342 2802 2807 759 2775 2781 1970 2803 1757 1958 2973 2446 2737 2910 2586 1402 2352 2196 2946 2997 1547 2606 2495 2004 2941 1351 1461 2261 2518 2414 2761 2583 376 2024 2727 2881 1596 2184 2366 2983 2580 1572 2945 2968 2769 2441 1807 2484 2445 2066 1825 2771 2567 ...

result:

ok accepted

Test #48:

score: 0
Accepted
time: 196ms
memory: 22840kb

input:

500 500 3000
120 735
270 735
156 857
284 776
215 764
102 826
206 929
460 861
486 839
166 693
452 811
298 768
276 928
315 978
196 828
132 746
436 786
222 775
21 619
88 611
320 960
194 874
498 975
410 706
409 924
327 979
275 644
257 925
202 611
280 849
394 816
220 505
224 645
322 799
95 695
313 621
21...

output:

2267
2906 2889 2454 1976 2919 2634 1796 2608 1807 2893 1035 2033 2461 2945 2035 2365 2493 1504 2788 2092 2480 1705 2088 2898 2207 1014 1052 1937 2024 2515 1651 2351 1951 2809 2470 2739 2840 960 306 2453 2843 1895 2826 1902 2199 2068 2932 2307 2688 2138 2367 2162 687 2490 132 2661 881 2061 1814 2017 ...

result:

ok accepted

Test #49:

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

input:

80 80 2999
78 101
75 105
33 137
9 104
76 122
42 116
6 135
51 155
62 95
9 107
34 125
68 160
34 111
56 132
65 102
71 133
67 101
37 130
60 133
8 113
60 113
61 121
77 101
42 157
1 94
74 115
53 100
65 113
29 147
42 122
43 85
28 139
54 125
42 148
21 154
62 115
69 91
54 148
64 144
8 125
38 142
51 93
39 104...

output:

2999
2833 1376 2992 2957 274 283 953 477 298 85 483 829 476 308 1329 578 1082 319 834 513 693 147 687 458 1408 518 316 903 646 1112 1224 2 572 573 1106 1287 438 654 1649 985 1275 86 158 1415 608 1339 1616 795 318 1217 1656 937 705 321 1036 653 249 1193 547 287 1083 746 488 355 946 686 747 416 182 46...

result:

ok accepted

Test #50:

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

input:

80 80 2997
79 159
53 129
68 88
34 99
6 90
62 143
13 135
76 121
80 127
30 151
12 141
6 88
42 107
23 122
39 152
80 128
5 91
36 104
9 89
67 131
63 88
25 158
35 118
61 123
44 113
73 116
22 150
10 87
71 81
29 119
25 104
3 110
63 152
5 139
61 97
57 112
17 95
70 99
32 89
23 124
3 153
17 155
51 159
27 101
7...

output:

2993
2896 115 2970 2921 354 747 1192 543 1180 440 2923 2907 632 761 669 185 457 731 832 1612 574 270 863 893 833 288 447 567 191 1429 971 715 590 609 1331 471 548 712 205 892 693 1309 782 408 1072 1486 482 579 218 592 1576 679 2080 234 882 763 1016 733 177 1185 285 983 495 751 136 1754 80 1288 741 5...

result:

ok accepted

Test #51:

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

input:

80 80 2997
57 81
6 112
14 102
29 159
15 103
53 109
6 87
11 145
45 148
43 85
57 82
68 116
29 129
41 86
57 126
42 100
68 136
74 154
38 141
26 144
37 107
5 81
24 95
61 131
48 149
27 88
75 99
4 134
15 104
29 146
13 102
16 128
70 101
52 100
26 154
72 127
17 113
45 102
32 158
28 83
42 159
22 121
58 158
2 ...

output:

2920
2867 599 2863 2648 345 332 672 996 741 276 683 1529 244 1209 811 966 637 1357 714 283 88 560 752 1077 401 664 363 350 716 475 1639 734 1009 305 385 743 259 407 582 418 542 736 570 49 409 412 647 740 197 809 1098 630 277 451 110 389 1326 256 989 71 2839 2602 171 1089 564 773 662 703 183 82 1204 ...

result:

ok accepted

Test #52:

score: 0
Accepted
time: 77ms
memory: 22068kb

input:

80 80 2999
34 150
76 97
22 138
13 130
65 152
39 145
69 103
20 108
10 100
66 95
60 93
17 126
6 110
2 113
79 158
77 155
65 119
50 108
1 123
22 130
11 83
51 125
58 124
72 118
3 105
59 90
24 122
63 99
36 97
73 104
9 121
13 124
35 99
60 134
24 104
55 96
29 100
10 102
20 129
70 133
63 89
16 150
17 111
37 ...

output:

2044
2731 1134 2962 2814 331 1209 669 734 1253 1430 587 684 694 283 48 163 1873 309 744 710 574 424 465 505 1972 896 1879 280 1426 1674 1153 1354 753 193 1850 508 839 446 776 786 706 794 345 711 1767 294 812 107 1564 601 1227 2073 803 736 716 337 843 947 1681 735 908 118 1389 565 463 891 1554 868 13...

result:

ok accepted

Test #53:

score: -100
Wrong Answer
time: 86ms
memory: 22888kb

input:

80 80 3000
26 107
48 88
12 145
29 150
77 156
12 137
36 143
11 120
71 129
51 134
48 96
12 116
5 135
31 151
12 85
80 147
54 119
73 87
38 159
10 83
2 154
4 139
51 114
66 118
73 97
64 146
27 104
36 100
53 85
80 157
8 150
48 123
42 160
61 81
42 108
46 122
74 94
52 116
42 96
2 93
63 103
21 87
28 88
57 155...

output:

536
2083 1576 2669 2398 2204 2504 2963 2278 2062 2974 1975 942 1209 2731 2862 1346 2887 2975 2438 2088 2855 2119 1734 1587 2927 2599 1039 2285 2450 2853 2968 2074 2990 2455 2922 1444 2686 1092 2189 1533 2863 2581 2715 2865 2994 1227 2499 2311 1761 2629 1905 1980 1695 2479 704 2212 154 1694 2471 2536...

result:

wrong answer wrong answer, we can do more operations