QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#817635#7597. Alexey the Sage of The Six PathsUrdAC ✓113ms159256kbC++175.0kb2024-12-17 09:00:562024-12-17 09:00:56

詳細信息

Test #1:

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

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: 6ms
memory: 34372kb

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
2 4
1 3
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: 3ms
memory: 38544kb

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
3 6
2 5
1 4
3 5
2 4

result:

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

Test #4:

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

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
2 4
1 3
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 4
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 3
1 3
1 3

result:

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

Test #5:

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

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
2 4
1 3
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: 42712kb

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
2 4
1 3
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: 12ms
memory: 38596kb

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
3 6
2 5
1 4
1 4
1 4
1 4
1 4
1 4
1 4
1 4

result:

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

Test #8:

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

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
3 6
2 5
1 4
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: 12ms
memory: 58988kb

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
3 6
2 5
1 4
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: 12ms
memory: 38624kb

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: 16ms
memory: 50852kb

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
1 8
4 7
3 5
1 8
1 8
1 8
1 8
1 6
1 6
1 6
1 6
1 6
4 7
4 7
4 7
3 7
3 7
3 7
3 7
3 5
2 5
2 5
2 5
2 5
2 5
2 5
1 5

result:

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

Test #12:

score: 0
Accepted
time: 18ms
memory: 60988kb

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
4 8
3 7
2 6
1 5
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: 3ms
memory: 54880kb

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: 15ms
memory: 54940kb

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: 7ms
memory: 42816kb

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
5 8
4 6
2 6

result:

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

Test #16:

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

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
6 11
5 12
4 9
3 8
6 10
6 7
6 7
6 7
5 12
4 12
4 12
4 12
3 12
3 9
3 9
2 8
1 8
1 8
6 8

result:

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

Test #17:

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

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
6 12
5 11
4 10
3 9
6 8
6 7
5 11
5 11
5 11
4 11
4 10
2 10
1 9
1 9

result:

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

Test #18:

score: 0
Accepted
time: 37ms
memory: 83016kb

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
2 11
6 12
5 10
4 9
3 7
2 11
2 8
2 8
2 8
2 8
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

result:

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

Test #19:

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

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
7 14
5 13
4 12
6 10
7 14
7 13
7 13
7 12
7 11
5 11
5 11
5 9
4 9
4 8
4 8
3 10
2 10
2 10
2 10
1 10

result:

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

Test #20:

score: 0
Accepted
time: 14ms
memory: 59064kb

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
7 13
5 12
6 14
4 11
7 13
7 13
7 12
5 10
5 9
5 8
4 14
3 14
2 11
2 11
1 11
1 11

result:

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

Test #21:

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

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
3 14
7 13
6 12
5 10
3 11
3 9
3 9
3 8
3 8
3 8
4 13
4 13
4 12
2 10
2 10
1 10
1 10

result:

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

Test #22:

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

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
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9
1 9

result:

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

Test #23:

score: 0
Accepted
time: 18ms
memory: 63316kb

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
4 16
3 12
8 14
7 13
4 16
4 16
4 12
4 12
3 11
3 10
3 9
8 14
8 14
7 14
7 13
5 13
1 13

result:

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

Test #24:

score: 0
Accepted
time: 29ms
memory: 71120kb

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
8 16
7 15
6 14
5 13
4 11
8 16
8 12
8 12
8 10
8 9
7 15
6 15
6 15
6 15
4 14
3 14
3 14
3 14
3 11
2 11
1 11
1 11

result:

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

Test #25:

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

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
6 15
5 14
4 13
3 12
2 11
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10
1 10

result:

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

Test #26:

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

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
1 18
9 16
8 14
7 13
6 12
5 10
1 17
1 15
1 11
7 16
6 16
5 14
4 14
4 13
3 13
2 13
2 12
2 10

result:

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

Test #27:

score: 0
Accepted
time: 47ms
memory: 79836kb

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
6 14
9 18
8 17
7 16
5 15
4 13
3 12
2 10
6 11
6 11
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

result:

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

Test #28:

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

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
10 16
9 19
6 17
5 11
10 15
10 12
9 19
6 17
3 17
1 17
1 11

result:

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

Test #29:

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

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
2 18
10 19
8 17
7 16
6 13
2 15
2 14
2 12
10 17
8 16
7 16
5 16
3 16
3 13
1 13

result:

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

Test #30:

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

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
8 20
1 18

result:

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

Test #31:

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

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
10 16
9 22
8 21
5 20
4 18
10 13
4 22
3 20
1 18

result:

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

Test #32:

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

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
11 22
9 20
10 21
8 19
7 18
6 17
5 16
11 20
11 15
11 14
9 13
9 12
9 12
10 21
5 21
5 21
5 19
5 19
4 18
4 18
3 17
3 17
3 17
2 16
1 16
1 16
1 16

result:

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

Test #33:

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

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: 20ms
memory: 59544kb

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
12 24
11 23
10 22
9 21
8 20
7 19
6 18
5 17
4 16
3 15
2 14
1 13
10 16
1 16

result:

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

Test #35:

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

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
12 24
11 23
10 22
9 21
8 20
7 19
6 18
5 17
4 16
3 15
2 14
1 13
12 24
10 22
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: 67ms
memory: 98312kb

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
7 22
12 24
10 23
9 20
8 19
6 18
5 17
4 14
7 22
7 21
7 21
7 16
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

result:

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

Test #37:

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

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: 14ms
memory: 64888kb

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
8 26
6 23
13 25
9 22
8 21
8 20
8 17
6 16
4 25
3 22

result:

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

Test #39:

score: 0
Accepted
time: 52ms
memory: 88868kb

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
7 24
6 23
13 26
12 22
10 20
9 18
8 17
7 21
7 21
6 19
6 16
6 15
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

result:

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

Test #40:

score: 0
Accepted
time: 30ms
memory: 66556kb

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
13 25
11 22
14 26
10 20
7 15
13 19
13 17
11 16
4 26
3 20
2 20
1 15

result:

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

Test #41:

score: 0
Accepted
time: 73ms
memory: 71752kb

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
14 25
7 24
13 28
12 27
11 26
10 23
9 18
8 17
14 24
14 22
14 21
7 20
7 19
7 16
7 15
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

result:

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

Test #42:

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

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
13 25
7 23
10 28
9 27
3 26
2 19
13 21
13 18
7 15
3 19

result:

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

Test #43:

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

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
14 29
13 27
12 26
10 24
8 21
7 20
6 19
4 18
1 16

result:

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

Test #44:

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

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
14 30
13 29
11 28
10 24
5 23
4 22
3 20
2 18
1 17
2 22

result:

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

Test #45:

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

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
11 25
10 21
14 28
13 27
9 17
11 20
10 16
8 28
5 27
4 17
2 17

result:

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

Test #46:

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

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
13 30
4 23
15 31
14 29
10 26
13 19
13 18
4 17
9 31
8 29
7 29
5 29
3 29
2 29
2 26
1 26

result:

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

Test #47:

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

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
11 32
9 31
1 30
15 29
13 22
12 19
10 17
11 27
11 24
9 21
9 21
9 20
1 18
1 18
15 29
12 22
10 22
8 22
7 22
6 22
6 19
5 19
3 17
3 17
2 17

result:

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

Test #48:

score: 0
Accepted
time: 18ms
memory: 74000kb

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
11 31
10 24
9 23
8 22
4 31

result:

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

Test #49:

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

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
17 34
16 32
15 31
14 30
13 29
12 28
11 26
10 25
8 23
5 22
4 20
2 19
1 18
12 32
12 30
10 29
1 28
1 25
1 22

result:

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

Test #50:

score: 0
Accepted
time: 48ms
memory: 90044kb

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
17 34
15 33
14 28
13 27
12 26
11 25
10 24
9 23
8 22
7 21
6 20
5 19
4 18
9 33
7 25
5 24
5 24
5 24
5 24
5 22
3 20
2 19
2 18
1 18
1 18

result:

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

Test #51:

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

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
10 26
15 34
13 33
11 32
9 30
7 29
6 28
5 23
4 22
3 21
2 20
10 19
10 18
15 33
13 30
11 23
5 22
5 21
2 21
2 20

result:

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

Test #52:

score: 0
Accepted
time: 21ms
memory: 92828kb

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
18 35
15 34
13 33
12 30
11 29
10 28
9 27
8 26
7 25
6 23
5 22
4 21
2 20
1 19

result:

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

Test #53:

score: 0
Accepted
time: 26ms
memory: 88732kb

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
17 34
15 33
14 31
13 29
12 28
11 27
10 26
8 25
7 24
6 23
4 22
3 21
2 20
1 19
8 19
7 19
4 19

result:

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

Test #54:

score: 0
Accepted
time: 70ms
memory: 116476kb

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
16 36
13 25
15 32
12 31
11 30
9 29
8 28
7 27
6 26
5 23
16 22
16 21
13 20
13 19
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

result:

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

Test #55:

score: 0
Accepted
time: 29ms
memory: 94200kb

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
18 37
16 27
19 31
14 29
13 26
12 25
9 22
18 23
16 20
13 31
8 29
8 26
3 25
3 22
1 22

result:

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

Test #56:

score: 0
Accepted
time: 26ms
memory: 73900kb

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
2 21
1 20
1 20
1 20
1 20
1 20
1 20
1 20

result:

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

Test #57:

score: 0
Accepted
time: 33ms
memory: 98564kb

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
19 34
12 32
2 28
18 36
17 35
11 30
10 27
19 25
12 24
12 23
2 21
2 20
8 36
6 30
5 27

result:

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

Test #58:

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

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
13 37
12 34
6 32
15 40
14 39
5 36
4 35
3 33
2 24
13 31
13 30
13 29
12 27
12 25
12 23
6 22
14 36
14 35
1 33
1 24

result:

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

Test #59:

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

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
20 40
16 37
15 36
12 32
9 31
8 29
4 28
2 27
1 24
2 27

result:

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

Test #60:

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

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

result:

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

Test #61:

score: 0
Accepted
time: 97ms
memory: 98552kb

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
17 38
15 36
21 42
20 41
18 40
16 39
13 30
12 29
10 28
8 26
7 23
17 35
17 34
15 33
15 32
15 25
21 42
16 41
13 41
13 39
10 39
6 39
6 39
5 30
4 30
3 29
3 28
2 26
1 26
1 23

result:

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

Test #62:

score: 0
Accepted
time: 25ms
memory: 75248kb

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: 20ms
memory: 83792kb

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: 29ms
memory: 86724kb

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
4 27
20 44
14 40
13 34
9 30
5 24
4 23
1 24

result:

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

Test #65:

score: 0
Accepted
time: 30ms
memory: 84052kb

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: 45ms
memory: 115956kb

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
21 33
22 44
19 43
18 41
16 37
15 36
14 35
13 34
11 32
10 30
9 26
21 23
19 41
18 41
11 37
9 36
8 35
5 32
5 30
3 30
1 26

result:

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

Test #67:

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

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: 54ms
memory: 91564kb

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

result:

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

Test #69:

score: 0
Accepted
time: 29ms
memory: 105400kb

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
19 44
15 40
7 35
3 33
23 46
16 42
14 38
11 37
19 32
15 31
7 28
3 27
10 42
9 38
2 37
2 37

result:

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

Test #70:

score: 0
Accepted
time: 84ms
memory: 107740kb

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
23 48
22 47
20 45
19 41
18 39
16 38
15 37
11 35
9 34
8 32
7 31
6 30
3 29
2 28
1 27
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: 32ms
memory: 89568kb

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: 27ms
memory: 102372kb

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
16 32
12 31
23 44
21 43
20 42
19 41
18 39
7 37
6 35
5 34
16 30
12 28
4 42
1 39

result:

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

Test #73:

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

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
21 49
16 44
11 41
10 39
7 33
5 27
2 26
21 44
16 41
11 41
11 41
11 41
11 41
11 39
10 27

result:

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

Test #74:

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

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: 110ms
memory: 132348kb

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

result:

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

Test #76:

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

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
19 48
15 47
14 44
11 43
1 40
23 52
21 51
13 50
9 45
19 39
15 37
14 36
14 32
11 31
11 30
1 27
8 50
3 45
2 45

result:

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

Test #77:

score: 0
Accepted
time: 58ms
memory: 106340kb

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
17 51
16 49
15 48
12 47
26 52
20 50
18 39
14 32
13 30
11 29
17 45
16 43
15 41
15 40
15 38
15 35
12 31
10 50
6 39
4 32
4 30
3 29
2 29

result:

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

Test #78:

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

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: 31ms
memory: 61044kb

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
13 54
7 40
3 39
7 40

result:

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

Test #80:

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

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
3 30
2 29
1 28
1 28
1 28
1 28
1 28

result:

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

Test #81:

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

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

result:

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

Test #82:

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

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
18 45
13 39
22 51
19 46
17 38
16 31
18 36
13 30
6 38
5 31

result:

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

Test #83:

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

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
19 37
3 35
27 52
26 46
14 44
10 43
9 38
7 34
19 31
3 29
4 34

result:

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

Test #84:

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

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
27 49
22 48
19 46
13 44
12 31
6 30
5 46

result:

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

Test #85:

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

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
28 56
27 55
26 54
25 51
23 50
17 49
15 48
14 47
13 45
12 43
11 40
10 38
9 37
7 36
5 35
4 34
3 33
2 30

result:

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

Test #86:

score: 0
Accepted
time: 89ms
memory: 109164kb

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
27 58
25 55
24 54
23 53
22 52
18 48
17 47
15 46
14 45
13 43
12 42
11 40
10 37
5 36
4 35
3 33
2 32
1 30
25 52
23 52
23 47
18 43
18 42
12 32
3 32

result:

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

Test #87:

score: 0
Accepted
time: 113ms
memory: 159256kb

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

result:

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

Test #88:

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

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
2 7
3 8
2 7
2 6
2 6

result:

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

Test #89:

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

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
2 8
3 6
2 8
2 5

result:

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

Test #90:

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

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: 4ms
memory: 30284kb

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!!!