QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#533430#7597. Alexey the Sage of The Six PathscarrotqqAC ✓63ms667728kbC++143.8kb2024-08-25 22:58:482024-08-25 22:58:49

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 35ms
memory: 529668kb

input:

2 0 2 2
8
9
3
4

output:

DEFEAT

result:

ok Participant and jury's answer are same!!!

Test #2:

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

input:

2 8 2 2
2 5 5 10 -10 -1 3 5 9
8 -10 9 9 0 1 -3 1 -1
0 5 -1 5 3 -9 1 10 6
5 -4 8 -2 2 -8 6 3 -3

output:

-21
1 3
2 4
2 4
2 4
2 3
1 3
1 3
1 3

result:

ok Participant and jury's answer are same!!!

Test #3:

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

input:

3 5 2 3
100 75 125 150 175 200
125 100 75 100 125 150
225 200 175 200 225 250
225 200 175 200 225 250
125 100 75 100 125 150
100 75 125 150 175 200

output:

650
1 4
2 5
3 6
3 5
2 4

result:

ok Participant and jury's answer are same!!!

Test #4:

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

input:

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

output:

-26
1 3
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 3
1 3
1 3
1 3

result:

ok Participant and jury's answer are same!!!

Test #5:

score: 0
Accepted
time: 27ms
memory: 529948kb

input:

2 27 2 2
1 3 15 57 57 117 153 237 253 271 451 517 709 917 1085 1145 1145 1451 1559 1901 2261 2513 2865 3233 3425 3575 3731 3785
0 10 34 52 68 108 120 246 310 382 422 620 764 946 1142 1352 1480 1718 1790 1790 1870 1954 2306 2720 3104 3154 3622 3892
3 11 31 67 75 115 163 163 307 451 631 675 819 975 11...

output:

3122
1 3
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
1 4
1 4
1 4
1 4
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3
1 3

result:

ok Participant and jury's answer are same!!!

Test #6:

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

input:

2 20 0 2
140 185 76 63 183 34 -397 35 47 177 139 48 106 142 122 88 115 59 184 164 194
150 174 7 94 141 77 47 2 154 38 72 112 31 137 -400 105 92 120 35 88 163
68 88 110 95 60 124 16 194 73 89 -576 9 61 68 57 194 38 7 37 147 51
47 17 56 126 113 108 130 81 158 32 -310 1 112 194 93 11 125 67 1 138 9

output:

-1683
1 3
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 3
2 3
2 3
2 3
1 3
1 3
1 3
1 3
1 3

result:

ok Participant and jury's answer are same!!!

Test #7:

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

input:

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

output:

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

result:

ok Participant and jury's answer are same!!!

Test #8:

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

input:

3 19 3 3
7 31 73 154 226 271 379 547 571 814 934 1132 1132 1366 1660 1750 1798 2155 2317 2602
5 29 35 80 104 119 209 398 566 674 704 737 917 1229 1313 1493 1829 2135 2189 2588
5 23 41 41 53 83 245 308 476 665 815 1046 1190 1229 1565 1835 2027 2078 2294 2522
0 12 66 138 150 210 264 453 501 690 930 11...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #9:

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

input:

3 26 3 3
13 158 190 171 189 20 97 -517 1 173 43 150 50 180 92 43 108 129 17 114 33 60 27 133 50 165 12
185 124 161 171 24 166 145 82 65 173 -771 10 29 126 189 63 60 68 171 111 48 14 152 13 6 173 65
0 137 114 55 16 181 31 121 81 -732 130 37 10 154 45 24 30 151 157 48 167 3 173 15 92 169 168
74 133 85...

output:

-3347
1 4
2 5
3 6
3 6
3 6
3 6
3 6
3 6
3 6
3 6
3 5
2 5
2 5
2 5
2 5
2 5
2 5
2 4
2 4
2 4
1 4
1 4
1 4
1 4
1 4
1 4

result:

ok Participant and jury's answer are same!!!

Test #10:

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

input:

4 1 0 3
5 15
7 25
2 8
6 22
8 16
7 7
0 14
9 15

output:

50
3 6

result:

ok Participant and jury's answer are same!!!

Test #11:

score: 0
Accepted
time: 20ms
memory: 533448kb

input:

4 27 0 3
1 3 31 55 79 149 257 355 387 387 407 407 575 653 821 971 1035 1273 1417 1759 1799 1799 2019 2341 2725 2975 2975 3245
4 12 24 78 102 142 166 264 296 422 502 524 620 620 620 800 1088 1258 1474 1588 1948 2326 2458 2872 3208 3308 3672 3780
4 16 32 62 102 102 174 272 304 340 500 544 592 644 700 ...

output:

1744
3 5
4 7
1 8
1 7
4 7
4 7
4 7
3 7
3 7
3 7
3 5
3 5
2 5
2 5
2 5
2 5
2 5
2 5
1 8
1 8
1 8
1 8
1 6
1 6
1 6
1 6
1 6

result:

ok Participant and jury's answer are same!!!

Test #12:

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

input:

4 30 2 4
28 163 149 196 71 30 154 -176 7 119 25 35 142 124 56 39 18 158 129 175 28 27 42 62 0 61 142 22 21 6 56
98 33 11 53 186 176 -463 26 106 99 176 28 189 125 94 4 107 64 70 181 131 143 113 76 55 71 47 99 40 181 110
58 137 166 143 142 47 17 144 -212 182 135 74 143 197 73 182 192 36 156 64 113 183...

output:

-2259
1 5
2 6
3 7
4 8
4 8
4 8
4 8
4 8
4 8
4 8
4 7
4 7
3 7
3 7
3 7
3 7
3 7
3 6
3 6
2 5
2 5
2 5
2 5
2 5
1 5
1 5
1 5
1 5
1 5
1 5

result:

ok Participant and jury's answer are same!!!

Test #13:

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

input:

5 12 1 1
0 12 12 93 177 252 288 477 693 855 945 1209 1209
3 3 51 60 60 75 75 75 291 399 519 717 1041
8 20 44 98 206 236 308 308 380 542 662 695 983
3 30 60 60 132 222 258 321 489 624 804 969 1149
2 29 59 68 92 107 125 272 464 545 545 809 1061
1 13 55 55 55 145 253 421 589 778 838 904 1228
2 23 41 41...

output:

878
4 8
4 8
4 8
2 8
2 8
2 8
2 8
2 8
2 8
2 8
1 8
1 8

result:

ok Participant and jury's answer are same!!!

Test #14:

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

input:

5 23 1 1
2 11 47 110 158 173 173 341 461 515 635 635 851 1046 1046 1136 1424 1526 2012 2126 2546 2546 2810 3224
7 34 64 145 241 286 304 430 478 694 934 934 1150 1150 1150 1150 1342 1444 1714 1771 2251 2251 2251 2251
6 21 63 126 162 252 324 387 483 645 855 855 1035 1308 1644 1779 1923 2178 2178 2520 ...

output:

2953
2 10
2 10
2 10
2 10
2 9
2 9
2 9
2 9
2 9
2 8
2 8
2 8
2 8
2 8
2 8
2 7
2 7
2 7
2 6
2 6
2 6
2 6
2 6

result:

ok Participant and jury's answer are same!!!

Test #15:

score: 0
Accepted
time: 11ms
memory: 529796kb

input:

5 3 1 3
-356 63 42 197
50 -745 125 170
-939 68 24 31
83 -295 99 116
2 -281 7 94
168 199 52 188
-7 152 162 132
53 -603 72 19
-234 168 87 129
-651 65 111 91

output:

-4059
4 6
5 8
2 6

result:

ok Participant and jury's answer are same!!!

Test #16:

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

input:

6 19 3 5
5 7 7 61 133 163 163 219 219 273 393 415 631 709 793 1003 1195 1365 1689 1841
5 11 39 51 115 125 137 137 153 279 319 407 551 577 633 783 783 1055 1271 1499
7 13 13 49 49 89 125 251 379 541 621 775 991 1199 1451 1661 1725 1963 2143 2181
2 8 24 30 30 120 180 208 224 278 358 424 640 822 822 85...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #17:

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

input:

6 14 3 5
4 12 24 48 52 62 86 100 116 179 199 265 301 327 411
5 5 23 44 52 62 104 132 132 132 142 230 254 345 415
4 6 22 43 55 100 148 162 162 243 313 379 463 541 555
5 13 27 36 64 79 79 79 103 175 265 309 393 406 518
9 9 21 27 39 74 116 165 189 198 258 302 386 477 561
4 11 15 15 35 65 89 138 186 222...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #18:

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

input:

6 28 3 6
138 136 119 86 -789 41 171 118 191 32 152 90 196 135 172 194 27 92 38 60 49 187 173 74 179 2 59 62 77
115 169 177 153 108 121 -388 63 75 151 15 26 102 17 156 168 9 144 64 173 15 120 70 23 179 150 56 150 122
88 139 5 85 81 133 40 -684 151 92 2 35 142 7 124 53 25 87 151 123 196 60 138 74 22 5...

output:

-5717
3 7
4 9
5 10
6 12
2 11
6 12
6 12
5 12
5 12
5 10
5 10
4 10
4 9
3 9
3 9
3 7
3 7
3 7
3 7
1 7
1 7
1 7
1 7
2 11
2 8
2 8
2 8
2 8

result:

ok Participant and jury's answer are same!!!

Test #19:

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

input:

7 20 4 4
5 26 80 161 185 275 383 509 581 716 776 974 1226 1304 1640 1955 2339 2645 2861 3089 3629
6 6 60 69 129 264 390 495 663 744 924 1122 1410 1488 1530 1755 2043 2094 2310 2367 2367
8 20 68 140 248 308 380 464 464 572 842 1007 1187 1265 1349 1709 2045 2147 2525 2696 2816
4 10 64 100 112 187 313 ...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #20:

score: 0
Accepted
time: 20ms
memory: 532164kb

input:

7 16 4 4
1 28 52 115 127 217 343 511 535 778 958 1189 1333 1645 1855 2035 2083
6 33 45 99 207 312 402 591 711 927 1137 1368 1620 1854 2232 2592 2688
2 2 44 98 182 272 362 467 515 677 737 803 1055 1328 1496 1676 1772
9 30 48 129 141 156 264 390 558 747 897 1095 1203 1242 1494 1584 1584
2 29 53 71 95 ...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #21:

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

input:

7 17 3 6
105 188 -64 6 130 171 172 163 95 2 91 196 24 26 34 111 42 137
141 157 2 38 148 124 25 130 31 61 85 49 47 43 176 91 77 126
180 1 59 98 145 92 83 -579 21 133 62 196 168 53 195 170 152 44
36 -8 108 74 42 191 83 147 148 9 77 11 193 17 65 91 107 124
109 11 103 100 139 82 139 6 150 4 56 174 76 13...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #22:

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

input:

8 30 1 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 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
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
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

66
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16
8 16

result:

ok Participant and jury's answer are same!!!

Test #23:

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

input:

8 17 1 4
9 12 28 34 62 67 67 116 140 158 228 305 341 445 571 661 661 661
4 12 26 44 56 71 71 71 87 87 137 148 172 263 333 468 580 716
5 5 5 11 11 41 65 93 133 214 304 359 443 534 604 634 650 650
1 1 3 3 15 15 39 53 69 105 115 126 138 190 218 278 342 342
3 7 15 42 58 93 123 172 244 262 292 358 406 45...

output:

234
7 13
8 14
3 12
4 16
8 14
8 14
7 14
7 13
5 13
1 13
4 16
4 16
4 12
4 12
3 11
3 10
3 9

result:

ok Participant and jury's answer are same!!!

Test #24:

score: 0
Accepted
time: 11ms
memory: 535196kb

input:

8 22 5 8
105 121 -117 21 12 93 92 88 70 79 126 137 54 64 28 193 199 180 122 31 57 173 11
123 92 77 135 68 172 146 76 146 174 98 196 69 87 175 172 113 154 17 181 44 25 104
20 15 170 140 -431 141 86 124 2 189 98 106 185 194 23 140 61 54 106 17 50 189 14
135 137 -389 106 140 184 62 29 71 142 108 102 14...

output:

-6664
4 11
5 13
6 14
7 15
8 16
7 15
6 15
6 15
6 15
4 14
3 14
3 14
3 14
3 11
2 11
1 11
1 11
8 16
8 12
8 12
8 10
8 9

result:

ok Participant and jury's answer are same!!!

Test #25:

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

input:

9 20 6 9
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3...

output:

86
4 13
5 14
6 15
7 16
8 17
9 18
9 18
9 18
9 18
9 18
9 18
9 18
9 18
9 18
9 18
9 18
9 18
9 18
9 18
9 18

result:

ok Participant and jury's answer are same!!!

Test #26:

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

input:

9 18 6 9
8 14 30 48 48 68 176 246 262 424 544 676 892 1100 1128 1128 1160 1296 1404
9 17 29 47 111 141 177 177 321 393 393 569 689 871 899 1049 1209 1311 1527
3 3 27 51 67 147 171 241 385 529 689 755 779 883 883 883 883 1121 1265
9 19 27 69 125 195 195 251 347 455 495 583 703 729 729 729 921 1159 11...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #27:

score: 0
Accepted
time: 20ms
memory: 536936kb

input:

9 29 8 9
40 -457 199 193 197 141 52 162 95 101 57 3 110 97 35 23 185 76 102 67 12 94 1 52 38 18 130 101 117 94
138 167 26 196 -863 75 73 26 74 32 45 163 190 107 6 63 70 35 71 76 170 158 145 170 42 33 140 151 187 21
119 184 39 24 -784 123 2 72 108 16 153 118 11 68 186 104 178 68 138 112 182 118 154 1...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #28:

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

input:

10 11 3 5
3 6 18 99 171 306 306 474 498 525 795 861
4 28 58 139 235 340 502 607 799 934 994 1093
6 12 66 66 66 96 240 261 477 531 531 630
0 18 30 93 153 273 345 492 588 642 792 957
7 10 22 94 190 310 400 442 586 640 850 1081
0 24 24 105 213 288 396 522 642 642 792 1023
8 26 62 143 179 254 254 338 36...

output:

264
5 11
6 17
9 19
10 16
9 19
6 17
5 17
3 17
1 11
10 15
10 12

result:

ok Participant and jury's answer are same!!!

Test #29:

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

input:

10 15 3 5
2 4 36 72 88 138 210 336 432 432 492 580 604 708 764 974
1 15 23 23 23 73 73 87 231 339 499 609 705 913 1081 1261
8 18 18 54 70 140 248 346 458 584 724 790 982 1216 1412 1592
5 13 33 87 119 199 223 265 281 371 511 643 643 773 857 1037
1 7 23 47 119 149 257 369 401 419 579 777 801 931 1155 ...

output:

271
6 13
7 16
8 18
10 19
2 17
10 18
8 16
7 16
5 16
3 16
3 13
1 13
2 17
2 15
2 14

result:

ok Participant and jury's answer are same!!!

Test #30:

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

input:

10 2 2 4
158 -78 56
-852 18 61
-552 130 127
-653 157 104
121 188 148
-779 182 173
101 185 190
111 -155 161
-343 169 56
-163 47 177
111 11 110
-551 192 114
68 85 166
-718 55 52
-927 162 59
-109 171 15
-469 193 6
92 -106 91
-492 81 90
98 -9 118

output:

-6555
1 18
8 20

result:

ok Participant and jury's answer are same!!!

Test #31:

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

input:

11 9 5 7
8 10 26 62 70 70 130 144 256 382
6 14 34 52 124 144 156 226 338 374
7 7 23 29 69 159 219 317 381 381
1 13 13 43 51 141 249 319 383 437
4 6 34 34 82 152 200 312 392 518
5 23 31 73 105 135 135 261 389 497
2 20 28 40 40 80 116 200 296 386
5 11 31 37 93 133 157 269 413 467
7 11 19 25 57 67 115 ...

output:

171
4 18
5 20
8 21
9 22
10 16
4 22
3 20
1 18
10 13

result:

ok Participant and jury's answer are same!!!

Test #32:

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

input:

11 27 5 7
2 4 16 22 50 85 127 183 223 241 271 326 386 386 512 542 542 661 715 810 950 1139 1139 1208 1400 1475 1683 1683
7 13 27 39 47 62 98 126 166 193 223 289 349 362 418 538 618 754 790 828 848 953 975 1044 1044 1069 1121 1121
6 11 13 16 52 52 106 148 156 165 195 239 323 427 441 471 615 666 702 7...

output:

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

result:

ok Participant and jury's answer are same!!!

Test #33:

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

input:

11 1 0 3
-294 8
58 96
-733 16
-165 21
-933 156
-611 199
128 -735
124 129
-435 130
-361 126
-582 170
-687 70
-302 108
-538 97
-338 176
-685 40
17 -755
-418 113
-286 184
-397 26
-762 14
-368 113

output:

-10203
7 17

result:

ok Participant and jury's answer are same!!!

Test #34:

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

input:

12 14 12 12
0 6 6 30 78 168 228 242 274 418 538 604 604 812 868
8 16 40 76 92 132 240 324 452 506 686 774 870 896 952
1 7 31 55 119 189 237 279 311 419 459 591 687 817 957
5 17 53 101 141 161 173 173 317 335 515 669 813 839 1007
8 26 38 56 80 130 190 232 312 348 448 448 616 668 808
4 20 36 60 124 18...

output:

346
1 13
2 14
3 15
4 16
5 17
6 18
7 19
8 20
9 21
10 22
11 23
12 24
10 16
1 16

result:

ok Participant and jury's answer are same!!!

Test #35:

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

input:

12 24 12 12
0 2 26 80 104 164 164 220 268 322 422 598 814 866 1034 1244 1276 1514 1802 2106 2386 2428 2692 2876 2972
5 17 25 31 95 175 199 297 361 505 565 587 635 661 661 721 721 721 865 979 979 1147 1455 1823 2063
2 12 16 64 64 94 106 148 180 288 448 558 702 884 1136 1166 1390 1390 1462 1462 1582 1...

output:

470
1 13
2 14
3 15
4 16
5 17
6 18
7 19
8 20
9 21
10 22
11 23
12 24
12 24
10 23
9 22
9 22
9 19
6 17
6 16
4 15
4 15
3 13
2 13
2 13

result:

ok Participant and jury's answer are same!!!

Test #36:

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

input:

12 29 8 12
28 -369 51 108 96 183 80 43 89 118 171 64 52 77 77 41 153 167 168 138 36 1 72 130 111 66 140 87 133 182
72 61 59 172 74 170 141 87 89 117 88 21 39 73 32 171 31 158 134 149 66 102 84 56 196 34 60 160 153 112
179 98 -364 155 57 151 32 68 106 13 21 35 44 147 53 3 116 171 149 82 196 4 54 116 ...

output:

-11167
4 14
5 17
6 18
8 19
9 20
10 23
12 24
7 22
12 24
12 24
10 23
8 23
8 20
6 20
5 19
4 19
4 19
4 18
3 18
3 18
2 17
2 17
2 17
2 14
1 14
7 22
7 21
7 21
7 16

result:

ok Participant and jury's answer are same!!!

Test #37:

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

input:

13 0 4 13
0
2
8
0
3
4
7
4
5
6
9
2
4
6
9
9
7
7
2
3
7
7
9
5
8
5

output:

DEFEAT

result:

ok Participant and jury's answer are same!!!

Test #38:

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

input:

13 10 4 13
8 15 21 27 55 55 109 116 116 161 241
3 10 20 44 56 91 109 109 165 246 246
6 8 26 35 51 76 88 102 142 214 264
8 12 22 40 76 81 81 130 154 163 213
6 13 15 42 58 78 96 131 139 148 188
1 5 9 18 22 32 56 105 161 170 180
8 17 25 46 54 89 107 149 165 174 264
7 11 25 25 25 45 81 116 132 159 249
5...

output:

172
9 25
13 26
6 21
8 23
4 26
3 25
8 20
8 18
8 17
6 16

result:

ok Participant and jury's answer are same!!!

Test #39:

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

input:

13 26 6 9
49 184 188 12 -63 90 168 178 38 60 184 81 67 90 125 124 56 119 99 37 83 129 30 122 151 125 192
56 33 173 -763 57 104 186 61 181 2 145 139 104 79 91 172 161 128 25 181 73 151 165 154 119 17 113
193 150 111 -337 176 121 31 15 173 162 78 25 157 73 9 174 189 143 134 7 45 168 53 137 30 12 103
-...

output:

-9433
8 17
9 18
10 20
12 22
13 26
6 23
7 24
12 26
10 26
5 22
5 20
3 20
3 20
3 20
2 20
2 18
2 18
1 18
1 17
1 17
1 17
7 21
7 21
6 19
6 16
6 15

result:

ok Participant and jury's answer are same!!!

Test #40:

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

input:

14 12 1 10
9 9 45 72 168 198 324 429 621 729 999 1164 1272
4 19 73 109 133 178 214 235 307 334 454 553 661
7 7 55 91 91 181 343 364 460 568 718 718 826
5 17 35 89 113 128 218 386 434 542 782 947 1091
9 36 90 117 141 261 387 555 555 555 795 927 1215
9 30 66 84 132 207 225 393 465 600 810 1008 1296
6 ...

output:

308
7 15
10 20
14 26
11 22
13 25
4 26
3 20
2 20
1 15
13 21
13 19
11 17

result:

ok Participant and jury's answer are same!!!

Test #41:

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

input:

14 30 1 10
3 3 3 45 69 89 149 275 323 359 499 521 545 675 703 703 895 1065 1317 1583 1863 1905 2257 2441 2777 3027 3183 3615 3951 3951 4431
6 14 30 66 90 90 138 166 166 238 378 488 656 656 908 968 1096 1402 1474 1778 1778 1862 1994 2040 2184 2434 2642 2966 3078 3136 3676
2 12 16 52 108 138 222 222 2...

output:

737
8 17
9 18
10 23
11 26
12 27
13 28
7 24
14 25
13 28
13 28
13 27
12 26
11 26
6 26
5 26
4 23
4 23
4 23
3 23
3 18
2 18
1 17
1 17
14 24
14 22
14 21
7 20
7 19
7 16
7 15

result:

ok Participant and jury's answer are same!!!

Test #42:

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

input:

14 10 6 9
-792 100 41 8 76 85 52 109 196 182 19
168 -696 115 45 156 19 47 33 80 14 57
18 85 15 138 77 50 108 65 2 197 3
-19 103 156 62 0 86 185 189 48 155 156
-757 169 189 84 152 74 20 126 84 107 173
-746 20 129 147 46 146 116 90 37 149 156
78 84 -665 5 12 23 119 171 56 113 178
-438 64 12 154 4 50 1...

output:

-13272
2 19
3 26
9 27
10 28
7 23
13 25
3 19
13 21
13 18
7 15

result:

ok Participant and jury's answer are same!!!

Test #43:

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

input:

15 9 9 13
7 15 43 61 69 69 141 267 347 365
7 17 33 75 115 125 209 307 419 563
8 24 60 90 162 162 162 246 390 516
0 4 36 90 90 100 148 176 320 464
8 22 50 74 114 154 262 360 360 396
9 11 39 69 101 101 161 273 305 395
6 6 18 72 104 104 176 288 320 482
2 2 14 68 100 110 110 138 154 262
1 11 11 35 107 1...

output:

220
1 16
4 18
6 19
7 20
8 21
10 24
12 26
13 27
14 29

result:

ok Participant and jury's answer are same!!!

Test #44:

score: 0
Accepted
time: 11ms
memory: 539400kb

input:

15 10 9 13
3 9 41 83 147 197 221 291 291 363 543
9 23 23 77 93 103 211 337 353 407 567
1 5 29 59 75 105 129 143 223 385 485
1 1 25 55 111 171 231 301 413 575 675
0 2 26 50 106 196 304 332 380 416 476
5 21 21 21 29 69 105 147 211 319 339
8 18 46 52 84 144 216 300 428 572 572
8 14 50 104 128 148 208 2...

output:

210
3 17
4 18
5 20
8 23
10 24
11 25
13 28
14 29
15 30
15 23

result:

ok Participant and jury's answer are same!!!

Test #45:

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

input:

15 11 5 7
60 140 170 6 151 99 9 12 49 40 1 15
120 -619 76 164 149 167 24 194 67 155 22 151
41 102 87 50 11 127 193 148 13 139 33 101
187 53 12 155 113 94 178 16 140 119 174 131
52 -566 105 47 86 125 154 195 170 2 111 163
-616 108 185 42 44 146 7 19 199 145 122 56
-910 114 191 185 152 198 4 62 191 14...

output:

-11736
9 17
13 27
14 28
10 21
11 25
8 28
5 27
4 17
2 17
11 20
10 16

result:

ok Participant and jury's answer are same!!!

Test #46:

score: 0
Accepted
time: 39ms
memory: 552460kb

input:

16 16 1 11
1 4 40 49 145 235 343 448 496 631 781 781 781 976 1060 1195 1627
8 20 20 101 209 209 227 374 470 470 470 470 650 767 893 1253 1589
5 11 41 50 86 131 167 167 287 368 428 461 461 812 1106 1511 1511
4 25 31 112 184 229 229 313 505 640 730 895 895 1246 1498 1858 2002
3 18 48 111 171 246 318 3...

output:

425
10 26
14 29
15 31
4 23
13 30
9 31
8 29
7 29
5 29
3 29
2 29
2 26
1 26
13 19
13 18
4 17

result:

ok Participant and jury's answer are same!!!

Test #47:

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

input:

16 25 1 11
9 30 30 39 99 174 300 384 600 789 909 942 978 1290 1584 1629 1821 1923 2139 2595 2835 2835 2835 3318 3966 4416
5 17 53 80 152 272 326 515 563 779 989 1187 1259 1532 1658 1703 1799 2207 2693 3149 3149 3716 4112 4250 4322 4772
1 25 25 88 184 319 427 448 472 715 925 1090 1306 1384 1594 1864 ...

output:

824
12 17
13 19
14 22
15 29
1 30
9 31
11 32
15 29
12 22
10 22
10 22
7 22
6 22
6 19
5 19
3 17
3 17
2 17
11 27
11 24
9 21
9 21
9 20
1 18
1 18

result:

ok Participant and jury's answer are same!!!

Test #48:

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

input:

16 5 4 8
-340 8 89 55 3 176
-596 81 40 51 141 178
12 156 120 0 44 73
143 -274 0 9 9 39
-275 192 190 81 173 185
-690 89 64 103 96 110
-490 178 137 80 62 152
196 -680 110 103 95 139
67 -132 180 26 96 161
184 -774 119 197 194 187
101 88 148 114 166 51
-254 77 197 127 5 184
-329 136 136 87 73 199
-585 1...

output:

-9990
8 22
9 23
10 24
11 31
4 31

result:

ok Participant and jury's answer are same!!!

Test #49:

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

input:

17 19 13 13
8 13 15 15 15 30 54 110 158 203 293 359 371 410 522 642 674 793 847 999
5 10 20 32 68 108 138 145 177 177 257 268 304 382 424 514 546 665 701 853
1 10 24 30 58 93 123 179 203 266 296 395 431 470 484 484 564 683 683 683
3 7 13 25 33 33 75 110 150 168 228 283 343 356 426 531 531 650 740 74...

output:

266
1 18
2 19
4 20
5 22
9 23
10 25
11 26
12 29
13 30
14 31
15 32
16 33
17 34
12 32
12 30
10 29
1 29
1 25
1 22

result:

ok Participant and jury's answer are same!!!

Test #50:

score: 0
Accepted
time: 27ms
memory: 564648kb

input:

17 25 13 13
2 12 16 46 62 142 190 288 384 492 652 674 674 856 996 1056 1280 1314 1638 1980 1980 2022 2198 2428 2620 2620
9 15 27 57 129 129 225 295 295 439 519 717 741 793 793 973 1037 1139 1211 1325 1405 1489 1709 1709 2141 2291
1 15 43 85 149 169 181 251 331 367 527 637 685 893 1005 1155 1411 1649...

output:

503
3 18
4 19
5 20
6 21
7 22
8 23
9 24
11 25
12 27
13 28
14 31
15 33
17 34
17 33
9 28
7 25
5 24
5 24
5 24
5 24
5 20
2 19
2 18
1 18
1 18

result:

ok Participant and jury's answer are same!!!

Test #51:

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

input:

17 20 11 12
57 148 173 198 8 33 81 189 155 17 17 154 110 115 169 1 162 64 189 3 57
155 112 50 -176 11 61 67 161 176 182 122 34 22 110 60 130 30 176 191 19 153
124 -234 23 4 111 30 8 194 66 75 33 79 44 17 146 17 119 73 100 144 47
128 -819 72 171 151 81 97 78 163 90 22 72 76 41 181 141 191 157 170 12 ...

output:

-11966
2 20
3 21
4 22
5 23
6 28
7 29
9 30
11 32
13 33
15 34
10 26
15 33
13 30
11 23
5 22
5 21
2 21
2 20
10 19
10 18

result:

ok Participant and jury's answer are same!!!

Test #52:

score: 0
Accepted
time: 20ms
memory: 553068kb

input:

18 14 14 17
4 5 21 39 47 47 101 129 193 265 335 368 440 557 585
7 11 29 41 45 80 134 134 198 216 216 249 321 347 473
1 10 24 45 77 87 105 161 185 203 203 247 343 447 489
2 3 9 12 12 57 69 90 106 142 142 164 188 253 295
7 10 22 22 46 76 94 101 141 213 283 360 372 398 426
8 9 19 46 54 69 93 142 174 23...

output:

275
1 19
2 20
4 21
5 22
6 25
7 26
8 27
10 28
12 29
13 30
15 33
16 34
17 35
18 36

result:

ok Participant and jury's answer are same!!!

Test #53:

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

input:

18 17 14 17
2 12 20 32 80 120 156 282 346 490 490 490 514 748 776 926 1214 1384
8 8 20 20 28 98 194 250 330 474 494 626 746 798 854 1034 1034 1068
2 6 22 52 100 140 164 248 312 366 546 546 570 700 812 842 1130 1198
0 8 8 20 92 102 174 244 324 450 510 598 790 868 1036 1306 1466 1670
1 19 51 93 125 16...

output:

340
1 19
2 20
3 21
4 23
6 24
8 25
10 26
11 27
12 28
13 29
14 31
15 33
17 34
18 35
18 19
8 19
4 19

result:

ok Participant and jury's answer are same!!!

Test #54:

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

input:

18 29 10 14
-255 28 91 118 18 112 101 111 19 78 132 187 128 42 36 166 142 170 182 25 159 146 181 31 134 76 96 166 54 124
-817 138 184 25 153 129 155 114 197 28 185 127 24 81 135 4 64 154 118 184 45 125 66 116 86 183 44 16 110 108
160 189 0 65 26 96 75 149 74 60 162 149 164 10 124 20 142 125 115 13 2...

output:

-11509
5 23
6 26
7 27
8 28
9 29
11 30
12 31
15 32
13 25
16 36
12 32
12 32
9 31
9 31
7 30
7 29
7 28
6 28
6 28
6 27
5 27
5 26
4 26
3 26
3 23
16 22
16 21
13 20
13 19

result:

ok Participant and jury's answer are same!!!

Test #55:

score: 0
Accepted
time: 11ms
memory: 558420kb

input:

19 15 2 9
4 7 49 130 178 268 286 475 595 784 844 1042 1042 1081 1333 1468
4 28 82 118 130 175 229 313 457 565 835 1099 1387 1621 1873 2053
0 9 15 60 108 123 213 339 387 414 534 831 831 831 831 1101
3 24 72 117 177 282 408 492 636 879 999 1032 1140 1140 1434 1749
1 16 46 55 115 130 130 193 265 265 50...

output:

341
9 22
12 25
13 26
14 29
15 31
18 27
19 37
13 31
8 29
8 26
3 25
3 22
1 22
19 23
18 20

result:

ok Participant and jury's answer are same!!!

Test #56:

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

input:

19 8 2 9
0 0 0 0 0 0 0 0 0
5 5 5 5 5 5 5 5 5
3 3 3 3 3 3 3 3 3
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9
6 6 6 6 6 6 6 6 6
4 4 4 4 4 4 4 4 4
6 6 6 6 6 6 6 6 6
5 5 5 5 5 5 5 5 5
2 2 2 2 2 2 2 2 2
0 0 0 0 0 0 0 0 0
2 2 2 2 2 2 2 2 2
7 7 7 7 7 7 7 7 7
9 9 9 9 9 9 9 9 9
8 8...

output:

166
18 37
19 38
19 38
19 38
19 38
19 38
19 38
19 38

result:

ok Participant and jury's answer are same!!!

Test #57:

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

input:

19 15 7 10
185 196 160 131 124 162 39 171 192 82 108 83 41 10 138 4
22 105 28 -195 35 78 131 43 183 110 13 99 45 166 111 159
-264 90 32 182 155 160 165 88 46 191 69 56 127 15 143 67
-730 57 106 189 143 20 83 132 112 105 100 53 140 76 61 163
27 -147 113 80 142 154 98 46 197 89 144 81 175 145 194 120
...

output:

-12549
10 27
11 30
17 35
18 36
2 28
12 32
19 34
8 36
6 30
5 27
19 25
12 24
12 23
2 21
2 20

result:

ok Participant and jury's answer are same!!!

Test #58:

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

input:

20 20 9 20
2 10 10 52 108 188 200 312 392 464 604 692 764 946 974 1094 1318 1318 1534 1648 1928
9 9 37 91 99 149 221 305 385 475 535 733 877 1085 1113 1323 1355 1661 1877 2219 2219
1 3 23 47 47 47 107 163 227 227 287 419 467 623 679 799 1023 1227 1371 1409 1449
3 7 19 43 107 177 237 251 379 487 607 ...

output:

384
2 24
3 33
4 35
5 36
14 39
15 40
12 32
13 34
20 37
14 36
14 35
1 33
1 24
20 31
13 30
13 29
13 27
12 25
12 23
12 22

result:

ok Participant and jury's answer are same!!!

Test #59:

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

input:

20 10 9 20
6 12 16 22 78 138 246 316 364 454 474
5 7 7 37 77 117 189 301 365 455 535
1 15 23 53 61 61 121 121 233 359 479
4 6 26 68 108 118 226 338 466 538 618
1 13 41 77 141 221 245 343 455 527 567
7 23 39 51 123 153 249 291 403 565 625
3 21 25 67 67 117 189 301 397 541 641
4 12 24 78 118 208 232 3...

output:

250
1 24
2 27
4 28
8 29
9 31
12 32
15 36
16 37
20 40
2 27

result:

ok Participant and jury's answer are same!!!

Test #60:

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

input:

20 22 8 13
3 37 25 -196 97 121 8 58 122 89 63 150 77 169 36 45 199 98 43 105 116 22 130
109 -41 136 191 4 109 73 131 65 144 69 176 71 117 110 94 92 126 37 194 22 52 135
173 -348 44 10 62 41 26 81 125 182 26 58 15 2 69 60 20 131 99 101 108 185 3
18 29 81 -580 73 71 195 97 13 81 72 184 69 37 55 7 179 ...

output:

-13093
11 22
12 23
13 26
14 29
15 37
20 38
1 39
4 40
12 38
11 38
10 37
10 37
9 29
8 26
7 23
6 23
3 23
2 22
4 34
4 28
1 27
1 21

result:

ok Participant and jury's answer are same!!!

Test #61:

score: 0
Accepted
time: 63ms
memory: 595312kb

input:

21 30 11 16
2 10 12 33 53 73 103 145 145 145 175 197 257 348 376 511 639 656 692 768 788 914 1068 1275 1275 1500 1708 1816 1984 2129 2339
2 7 17 38 74 79 91 154 194 266 296 307 379 431 557 647 759 776 866 980 1020 1167 1167 1236 1404 1504 1712 1766 1850 1995 1995
7 15 17 26 58 103 139 160 224 269 34...

output:

392
8 23
10 26
12 28
13 30
16 38
18 39
19 40
20 41
21 42
15 35
17 36
21 42
16 41
13 41
13 39
7 39
6 39
6 39
5 39
4 38
3 30
3 28
2 26
1 26
1 23
17 34
17 33
15 32
15 29
15 25

result:

ok Participant and jury's answer are same!!!

Test #62:

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

input:

21 10 11 16
6 6 26 50 82 112 148 176 176 338 418
6 18 34 64 128 198 222 236 380 488 588
9 17 21 63 135 215 311 311 327 399 459
9 27 47 83 155 205 277 375 519 573 753
4 6 14 20 44 114 126 210 226 352 472
4 12 48 66 122 172 268 352 480 552 652
9 9 29 59 91 131 203 287 431 521 581
1 3 15 69 101 121 205...

output:

DEFEAT

result:

ok Participant and jury's answer are same!!!

Test #63:

score: 0
Accepted
time: 11ms
memory: 529164kb

input:

21 0 0 2
-81
-807
-354
23
-582
-416
-16
-621
-845
179
-546
-570
-781
-697
-300
-358
-319
50
-653
-767
-875
-681
-501
-25
-672
-352
-374
-424
-155
-772
-650
-661
-22
-475
-591
-456
-586
-831
-945
-192
-659
-611

output:

-19971

result:

ok Participant and jury's answer are same!!!

Test #64:

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

input:

22 8 6 7
2 4 16 64 104 124 208 334 414
0 16 28 40 48 48 48 132 164
9 17 49 79 127 177 249 347 491
1 1 1 37 85 135 231 273 369
1 1 21 33 41 111 207 305 385
7 19 23 53 85 145 241 269 269
6 20 48 72 88 118 178 276 324
8 20 32 32 64 134 182 308 340
8 10 38 92 148 188 284 298 314
2 20 24 54 54 114 150 15...

output:

207
13 28
14 34
19 40
20 41
21 44
4 30
5 28
4 23

result:

ok Participant and jury's answer are same!!!

Test #65:

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

input:

22 3 6 7
5 17 53 89
5 11 41 50
4 22 70 124
6 21 27 99
6 33 33 105
3 9 21 39
0 18 66 138
0 15 69 141
4 16 22 94
3 6 18 18
4 25 61 97
9 27 57 75
8 23 35 107
8 35 53 80
2 8 20 92
8 29 77 131
9 24 54 63
5 32 68 149
1 19 49 58
6 12 48 57
5 14 20 65
8 14 26 71
4 22 52 79
0 21 27 36
9 21 63 63
0 18 24 24
4...

output:

DEFEAT

result:

ok Participant and jury's answer are same!!!

Test #66:

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

input:

22 21 11 13
141 -106 85 106 92 17 78 134 71 96 3 121 120 121 74 23 130 76 92 87 130 32
-79 101 181 30 13 67 40 181 151 77 54 167 181 14 4 154 104 179 120 113 199 57
132 -44 68 199 141 45 119 79 150 190 45 33 141 90 20 51 29 168 158 118 17 115
-514 184 128 192 16 45 84 12 42 49 50 51 14 104 64 107 11...

output:

-18012
9 26
10 30
11 32
13 34
14 35
15 36
16 37
18 41
19 43
22 44
21 33
19 41
18 41
11 37
9 36
8 35
5 32
5 30
3 30
1 26
21 23

result:

ok Participant and jury's answer are same!!!

Test #67:

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

input:

23 5 18 20
4 11 17 26 50 95
6 12 18 39 59 84
6 15 21 30 54 69
2 4 16 25 29 44
1 3 11 14 18 63
5 11 23 44 52 52
0 3 9 27 63 63
0 9 9 21 53 63
2 6 10 28 28 63
5 7 15 18 54 74
5 5 5 29 37 47
9 14 28 55 55 85
9 9 17 23 47 92
2 3 9 12 36 51
7 9 11 14 30 50
0 8 20 38 42 42
1 9 25 31 51 91
0 2 14 32 36 41
...

output:

DEFEAT

result:

ok Participant and jury's answer are same!!!

Test #68:

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

input:

23 23 18 20
1 28 58 67 151 286 358 463 607 769 889 1153 1441 1792 1792 1792 1840 2095 2527 2584 2644 2770 2836 2974
7 28 34 43 103 193 229 355 403 592 682 847 991 991 1327 1327 1615 1717 1825 1825 2245 2497 2959 3304
2 23 35 98 170 305 431 431 503 665 815 980 1196 1547 1883 1883 2315 2570 2894 3008 ...

output:

526
2 24
3 25
4 27
5 29
6 30
7 31
8 33
9 34
13 35
14 36
15 37
17 38
18 39
19 40
20 42
21 44
22 45
23 46
22 42
20 36
20 36
20 35
17 30

result:

ok Participant and jury's answer are same!!!

Test #69:

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

input:

23 16 8 10
13 194 89 84 145 31 92 175 119 54 165 133 139 142 166 190 128
50 54 -692 56 155 44 113 154 180 175 189 53 82 70 192 9 137
84 195 -361 149 61 88 130 161 92 143 169 57 9 153 137 170 132
-407 140 182 105 19 193 198 39 14 33 199 41 47 0 150 98 16
-566 136 147 148 71 110 124 56 111 194 144 142...

output:

-18906
11 37
14 38
16 42
23 46
3 33
7 35
15 40
19 44
10 42
9 38
2 37
2 37
19 32
15 31
7 28
3 27

result:

ok Participant and jury's answer are same!!!

Test #70:

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

input:

24 26 15 20
6 10 14 38 38 118 190 302 446 446 626 714 906 1114 1338 1488 1712 1882 1954 2296 2336 2672 2804 2896 2944 3044 3200
5 15 47 89 89 119 203 273 321 321 481 569 737 893 949 1159 1415 1619 1835 1873 2153 2153 2505 2597 3029 3329 3641
7 9 25 31 95 145 217 315 315 405 445 643 739 895 895 1045 ...

output:

498
1 27
2 28
3 29
6 30
7 31
8 32
9 34
11 35
15 37
18 38
19 39
20 41
22 45
23 47
24 48
23 47
20 45
19 37
19 37
15 31
8 31
6 29
6 29
3 28
3 27
1 27

result:

ok Participant and jury's answer are same!!!

Test #71:

score: 0
Accepted
time: 11ms
memory: 537896kb

input:

24 6 15 20
5 14 26 44 52 77 107
8 17 29 53 85 95 131
2 7 19 34 58 93 99
4 10 12 18 46 56 62
6 9 21 30 54 94 100
8 14 28 28 28 58 88
3 7 7 7 15 50 74
3 5 17 26 54 59 71
1 9 21 24 44 44 80
3 9 15 39 47 72 114
1 9 23 47 63 103 115
6 14 32 35 35 40 70
0 3 5 5 37 72 108
5 10 24 30 54 59 95
7 7 19 31 47 6...

output:

DEFEAT

result:

ok Participant and jury's answer are same!!!

Test #72:

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

input:

24 14 10 14
114 -658 46 129 108 6 57 196 77 29 91 164 101 28 186
-101 33 147 115 78 163 174 168 69 54 121 56 113 11 27
-535 3 45 115 189 199 107 165 3 141 49 84 77 116 169
104 -649 86 143 96 135 75 195 88 50 156 196 43 118 28
53 -30 65 143 87 135 155 80 38 64 168 49 199 80 121
19 40 125 43 111 117 5...

output:

-18563
5 34
6 35
7 37
18 39
19 41
20 42
21 43
23 44
12 31
16 32
4 42
1 39
16 30
12 28

result:

ok Participant and jury's answer are same!!!

Test #73:

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

input:

25 15 7 21
9 27 69 87 99 114 168 252 324 405 405 471 687 999 1083 1083
2 11 65 137 185 320 410 431 623 785 1025 1124 1196 1235 1445 1490
6 21 39 57 105 150 240 345 345 399 639 936 1188 1305 1641 1821
7 28 40 76 112 157 319 319 511 727 787 787 895 1129 1507 1867
0 6 60 123 159 264 318 486 534 750 102...

output:

365
11 26
16 27
18 33
19 39
20 41
21 44
25 49
21 44
16 41
11 41
11 41
11 41
11 41
11 39
5 27

result:

ok Participant and jury's answer are same!!!

Test #74:

score: 0
Accepted
time: 39ms
memory: 531040kb

input:

25 2 7 21
5 29 29
7 16 16
4 28 58
7 28 46
6 24 48
3 30 30
2 11 23
3 9 57
6 27 57
8 29 41
0 18 30
1 22 70
5 5 59
4 16 28
0 12 30
6 30 48
5 32 62
7 16 34
5 29 65
8 26 44
1 25 55
6 12 12
6 15 45
1 13 31
8 17 23
5 11 59
8 20 50
7 19 31
3 6 48
0 24 60
9 27 51
2 2 44
9 27 57
3 12 48
9 15 69
3 30 30
7 31 6...

output:

DEFEAT

result:

ok Participant and jury's answer are same!!!

Test #75:

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

input:

25 27 12 16
103 69 -871 42 137 161 61 67 11 196 77 72 80 112 65 129 8 150 41 198 47 144 7 169 7 80 100 68
188 -226 157 22 158 189 185 71 45 136 105 142 167 191 196 52 8 159 11 65 115 187 71 42 98 84 2 2
-625 175 39 161 13 1 64 127 31 79 37 116 153 111 71 18 135 160 39 172 77 106 25 137 43 6 17 108
-...

output:

-18288
13 26
14 29
16 32
17 39
19 41
21 44
23 48
5 43
15 45
20 46
22 47
25 50
13 48
12 44
9 44
8 41
7 39
6 39
2 32
1 29
1 26
25 37
22 35
20 34
15 31
5 30
5 28

result:

ok Participant and jury's answer are same!!!

Test #76:

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

input:

26 19 9 17
2 6 6 24 32 42 90 104 104 131 221 309 321 321 433 538 586 603 747 861
7 7 19 22 30 60 102 102 150 231 271 359 395 486 556 571 587 587 749 901
1 5 15 33 45 85 85 148 212 293 383 438 438 464 576 621 733 733 823 823
2 8 16 40 60 100 148 211 235 307 307 362 422 448 462 522 666 666 756 927
3 1...

output:

315
13 45
21 50
23 51
26 52
1 40
11 43
14 44
15 47
19 48
9 50
8 45
2 45
19 39
15 37
14 36
14 32
11 31
11 30
1 27

result:

ok Participant and jury's answer are same!!!

Test #77:

score: 0
Accepted
time: 43ms
memory: 618852kb

input:

26 23 9 17
4 9 19 22 46 91 127 162 178 259 339 339 387 465 507 537 617 668 794 946 986 1154 1154 1292
8 10 14 41 61 106 106 155 163 235 325 380 464 516 572 602 650 684 792 925 1105 1273 1273 1296
4 5 13 25 49 94 94 143 199 199 209 220 244 296 338 338 482 635 761 837 837 1005 1159 1274
2 6 8 17 33 63...

output:

330
11 29
13 30
14 32
18 39
20 50
26 52
12 47
15 48
16 49
17 51
10 50
6 39
4 32
4 30
3 29
2 29
17 45
16 43
15 41
15 40
15 38
15 35
12 31

result:

ok Participant and jury's answer are same!!!

Test #78:

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

input:

26 2 1 2
-846 124 71
-725 144 25
-283 116 86
-37 83 198
-95 137 170
-553 5 77
36 122 39
-799 163 161
-668 117 95
-605 36 186
176 147 65
-720 53 167
-503 125 8
102 112 133
-137 108 50
-671 101 32
-212 45 37
-286 134 21
-24 85 183
-903 188 174
-146 115 141
-879 56 146
-579 45 24
-837 188 72
66 134 -88...

output:

-21608
25 41
25 41

result:

ok Participant and jury's answer are same!!!

Test #79:

score: 0
Accepted
time: 27ms
memory: 535364kb

input:

27 4 3 7
7 34 52 115 211
5 20 32 104 164
1 1 49 103 199
5 20 26 89 101
4 13 43 124 136
5 32 50 131 191
1 4 10 37 61
3 30 36 36 84
5 23 59 104 152
5 23 59 131 167
7 19 37 64 112
6 21 45 90 174
3 6 18 18 90
1 28 70 70 178
4 16 16 61 157
6 12 42 60 84
4 22 40 94 142
4 25 25 25 25
1 25 67 103 139
0 27 5...

output:

243
7 39
13 40
16 54
3 40

result:

ok Participant and jury's answer are same!!!

Test #80:

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

input:

27 7 3 7
7 7 7 7 7 7 7 7
0 0 0 0 0 0 0 0
5 5 5 5 5 5 5 5
5 5 5 5 5 5 5 5
7 7 7 7 7 7 7 7
7 7 7 7 7 7 7 7
2 2 2 2 2 2 2 2
6 6 6 6 6 6 6 6
5 5 5 5 5 5 5 5
8 8 8 8 8 8 8 8
3 3 3 3 3 3 3 3
0 0 0 0 0 0 0 0
9 9 9 9 9 9 9 9
4 4 4 4 4 4 4 4
8 8 8 8 8 8 8 8
7 7 7 7 7 7 7 7
3 3 3 3 3 3 3 3
0 0 0 0 0 0 0 0
8 8...

output:

235
25 52
26 53
27 54
27 54
27 54
27 54
27 54

result:

ok Participant and jury's answer are same!!!

Test #81:

score: 0
Accepted
time: 11ms
memory: 602996kb

input:

27 19 13 17
-395 35 150 100 190 13 65 134 0 28 149 67 163 17 196 7 2 54 21 185
183 -386 31 63 175 76 40 89 188 11 94 83 160 34 3 79 33 10 144 112
63 162 -312 76 144 171 96 98 189 191 166 69 90 107 69 69 80 198 73 125
23 170 -536 185 21 27 70 2 97 39 173 123 36 105 19 133 186 45 15 36
-204 176 84 166...

output:

-18648
10 30
11 34
12 39
13 40
17 42
19 43
22 47
23 50
25 51
26 53
27 54
4 35
21 38
7 42
3 34
3 30
2 30
21 32
4 29

result:

ok Participant and jury's answer are same!!!

Test #82:

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

input:

28 10 3 14
3 12 60 132 240 315 387 408 528 663 933
4 31 85 103 127 172 316 379 523 631 901
7 13 25 52 112 232 304 388 532 694 814
0 9 15 96 96 96 186 228 276 357 447
0 0 54 90 90 210 282 303 471 687 717
4 7 37 73 169 199 325 514 514 568 628
0 21 75 102 114 159 177 261 381 516 666
3 15 33 69 105 210 ...

output:

318
16 31
17 38
19 46
22 51
13 39
18 45
6 38
5 31
18 36
13 30

result:

ok Participant and jury's answer are same!!!

Test #83:

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

input:

28 11 3 14
8 32 86 167 239 329 437 542 542 704 764 764
1 28 40 121 133 178 286 349 421 502 502 535
3 9 9 18 102 102 228 417 561 723 813 945
6 12 42 96 108 183 201 222 222 330 390 687
2 20 56 110 182 257 293 440 536 725 845 1109
4 31 85 103 115 190 298 466 562 616 736 769
3 9 51 60 96 96 150 234 402 ...

output:

271
10 34
14 45
20 46
25 49
26 52
27 56
3 43
19 44
9 34
19 35
3 29

result:

ok Participant and jury's answer are same!!!

Test #84:

score: 0
Accepted
time: 55ms
memory: 543692kb

input:

28 7 5 6
-542 117 138 100 20 65 161 148
-750 199 170 67 99 0 106 43
-364 163 82 157 186 136 83 189
-364 130 100 151 81 59 106 138
107 -720 63 52 178 64 86 112
109 -75 25 72 186 88 118 143
-435 172 170 81 32 41 23 101
-46 42 197 77 182 44 101 190
9 181 123 76 80 171 53 103
-764 131 96 7 63 189 170 84...

output:

-24478
6 30
12 31
13 44
19 46
22 48
27 49
5 46

result:

ok Participant and jury's answer are same!!!

Test #85:

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

input:

29 18 18 27
6 33 33 87 123 228 354 459 483 699 879 1077 1077 1155 1323 1458 1746 1950 1950
0 3 33 78 126 261 351 435 483 510 570 603 855 1050 1386 1701 2133 2133 2187
5 23 41 122 182 242 278 467 467 467 737 1034 1250 1328 1370 1595 1883 2087 2087
1 19 49 76 148 283 355 439 463 625 715 979 1195 1351 ...

output:

552
2 30
5 33
7 34
9 35
10 36
11 37
12 38
13 40
14 43
15 45
17 47
18 48
23 49
24 50
25 51
26 54
27 55
28 56

result:

ok Participant and jury's answer are same!!!

Test #86:

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

input:

29 25 18 27
2 14 56 110 194 284 338 464 680 788 1028 1094 1418 1457 1625 1850 2282 2690 3176 3632 3872 4313 4841 4910 5486 5711
2 17 71 71 155 290 452 536 608 797 857 857 965 1160 1454 1769 1961 2267 2537 2708 2708 3275 3341 3962 4106 4256
0 0 6 87 195 210 264 306 450 612 612 612 720 915 1251 1521 1...

output:

603
1 32
3 33
5 35
10 36
11 37
12 40
13 42
14 43
15 45
17 46
18 47
22 48
23 50
24 52
25 53
26 54
27 55
29 58
25 58
23 53
23 52
18 52
18 47
12 43
3 42

result:

ok Participant and jury's answer are same!!!

Test #87:

score: 0
Accepted
time: 35ms
memory: 667728kb

input:

29 28 14 16
-668 10 3 179 2 140 189 157 145 63 151 181 10 125 58 149 65 184 24 147 94 111 48 144 65 81 190 136 20
131 -213 21 88 9 107 158 102 13 131 14 34 75 121 168 36 103 171 94 72 40 195 191 65 39 121 67 172 144
52 56 -547 101 172 14 50 132 147 13 65 185 31 80 102 163 7 116 68 128 150 52 16 134 ...

output:

-24943
5 32
6 35
7 39
10 40
12 44
15 51
17 52
23 55
25 56
27 57
29 58
18 47
20 48
28 50
12 58
7 44
5 44
5 40
4 39
3 35
3 32
2 32
28 43
28 41
28 38
20 36
18 34
18 31

result:

ok Participant and jury's answer are same!!!

Test #88:

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

input:

4 5 2 4
16 -1 -1 48 -44 4
30 -17 16 -19 -39 -5
16 -37 -32 -30 41 -19
-31 9 -26 24 -6 -12
-39 35 -2 -15 -25 -3
43 42 -7 39 -46 -17
27 5 -45 -13 -43 27
26 -38 3 -16 -42 39

output:

-220
3 8
2 7
2 7
2 6
2 6

result:

ok Participant and jury's answer are same!!!

Test #89:

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

input:

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

output:

-37
3 6
2 8
2 8
2 5

result:

ok Participant and jury's answer are same!!!

Test #90:

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

input:

3 4 1 2
57 17 48 27 -18
-43 -3 -28 16 -50
-7 -44 15 53 24
38 6 33 48 -64
42 -9 -57 -2 -43
57 -47 22 40 30

output:

-166
1 6
1 5
1 5
1 4

result:

ok Participant and jury's answer are same!!!

Test #91:

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

input:

2 2 1 1
-4 0 2
2 2 0
3 -5 1
0 -3 2

output:

-12
2 4
2 3

result:

ok Participant and jury's answer are same!!!