QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#415371#8410. Splatanie ciągów [A]_map_10 ✓4593ms46948kbC++175.0kb2024-05-20 20:08:452024-05-20 20:08:45

詳細信息

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 1ms
memory: 8096kb

input:

1 1
1
2

output:

0 1 

result:

ok single line: '0 1 '

Test #2:

score: 0
Accepted
time: 1ms
memory: 7872kb

input:

2 1
2 3
1

output:

0 3 0 

result:

ok single line: '0 3 0 '

Test #3:

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

input:

1 3
1
4 2 3

output:

0 6 0 0 

result:

ok single line: '0 6 0 0 '

Test #4:

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

input:

3 4
4 6 7
2 1 3 5

output:

0 60 0 0 0 0 0 

result:

ok single line: '0 60 0 0 0 0 0 '

Test #5:

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

input:

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

output:

0 2741 284 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 2741 284 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #6:

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

input:

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

output:

0 765 60 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 765 60 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #7:

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

input:

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

output:

0 1592 746 109 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 1592 746 109 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #8:

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

input:

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

output:

0 2475 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 2475 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #9:

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

input:

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

output:

0 1597 1004 304 100 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 1597 1004 304 100 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #2:

score: 1
Accepted

Test #10:

score: 1
Accepted
time: 0ms
memory: 18176kb

input:

30 30
21 60 56 26 50 1 4 52 51 58 34 13 54 59 7 28 33 46 18 39 43 37 32 36 19 25 30 16 38 55
45 23 48 40 2 17 29 27 57 53 12 6 49 15 3 31 9 5 20 44 47 24 11 22 10 42 41 35 8 14

output:

0 149064 63399 3762 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 149064 63399 3762 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #11:

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

input:

26 30
39 46 51 22 6 18 42 56 17 21 12 54 7 33 2 35 23 4 41 31 44 47 38 55 36 25
15 24 30 9 50 48 32 49 26 16 19 34 52 37 29 53 8 1 3 43 45 14 5 11 40 28 20 27 10 13

output:

0 117880 42735 2600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 117880 42735 2600 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #12:

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

input:

20 30
20 29 4 3 46 9 33 12 34 16 41 23 18 49 8 27 42 1 22 28
2 40 7 47 39 19 5 30 31 21 25 45 17 11 26 38 43 13 24 14 37 15 36 6 48 50 10 32 44 35

output:

0 77108 19422 1120 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 77108 19422 1120 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #13:

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

input:

29 30
45 41 37 36 34 32 21 18 16 15 13 11 7 3 2 9 23 25 31 39 42 46 47 48 52 54 57 58 59
56 55 51 43 40 38 35 28 24 22 14 8 6 4 1 5 10 12 17 19 20 26 27 29 30 33 44 49 50 53

output:

0 49187 82131 32026 15994 9635 5169 4611 1224 678 560 442 324 206 88 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 49187 82131 32026 15994 9635... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #14:

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

input:

30 29
25 22 38 32 33 1 58 15 52 48 50 34 39 27 40 36 44 19 37 9 31 2 16 8 26 7 56 41 45 12
28 21 54 43 55 17 30 14 20 18 59 46 51 3 35 5 42 29 57 11 47 24 49 23 53 10 13 4 6

output:

0 202275 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 202275 0 0 0 0 0 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #15:

score: 0
Accepted
time: 1ms
memory: 7840kb

input:

30 30
59 56 54 53 48 46 44 43 42 41 40 38 36 33 30 28 27 26 25 24 22 21 17 16 15 10 8 6 4 3
60 58 57 55 52 51 50 49 47 45 39 37 35 34 32 31 29 23 20 19 18 14 13 12 11 9 7 5 2 1

output:

0 44487 87654 35016 17978 10540 6702 4504 3014 2196 1434 1020 780 540 300 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 44487 87654 35016 17978 1054... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #16:

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

input:

30 30
3 49 41 35 33 16 12 17 26 32 60 59 56 50 31 25 9 1 22 23 39 37 34 27 19 6 4 15 11 8
20 29 21 13 7 58 57 54 52 51 48 47 10 28 45 36 14 5 2 38 40 42 44 55 53 46 43 30 24 18

output:

0 79069 85159 28733 17620 3994 1650 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 79069 85159 28733 17620 3994... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #17:

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

input:

30 30
27 4 19 13 31 20 34 38 42 44 47 50 51 52 54 55 59 23 30 32 26 17 12 46 45 41 37 28 5 2
60 58 57 56 49 40 9 10 16 21 35 15 22 6 3 7 53 48 36 29 25 14 11 1 18 33 43 24 39 8

output:

0 96660 78586 24374 11611 1910 3084 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 96660 78586 24374 11611 1910... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #18:

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

input:

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

output:

0 579 387 357 309 231 189 108 33 27 21 15 9 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 579 387 357 309 231 189 108 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #19:

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

input:

30 30
14 27 51 41 18 38 42 39 7 48 59 43 21 35 52 20 11 44 49 36 5 56 60 17 16 25 37 23 12 28
24 22 3 32 58 45 2 53 54 47 26 46 50 29 8 9 30 19 10 34 40 15 6 31 33 4 1 55 57 13

output:

0 127409 88816 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 127409 88816 0 0 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #20:

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

input:

30 30
31 23 22 12 40 53 60 13 5 1 7 32 45 37 33 26 41 55 56 42 29 18 52 57 58 21 16 11 19 50
49 34 8 4 30 38 47 43 25 15 17 28 36 9 6 3 20 27 46 39 10 2 14 24 59 54 48 35 44 51

output:

0 96399 70758 49068 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 96399 70758 49068 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #3:

score: 1
Accepted

Test #21:

score: 1
Accepted
time: 0ms
memory: 18096kb

input:

100 100
3 185 115 158 149 111 166 94 76 141 167 193 49 11 95 99 97 89 191 98 32 8 20 170 179 63 190 50 4 16 70 75 169 125 178 198 5 71 30 12 128 6 107 62 90 116 39 173 133 31 139 162 144 195 28 160 23 53 55 78 182 153 114 157 46 92 188 43 177 192 124 150 79 146 80 102 7 77 18 82 165 17 15 197 119 14...

output:

0 16086875 8174944 1124681 116000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 16086875 8174944 1124681 116... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #22:

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

input:

100 54
86 71 64 149 76 137 121 126 96 50 42 82 72 100 26 43 104 32 107 128 108 115 27 23 109 54 67 45 143 116 19 12 47 68 6 117 142 61 22 102 144 129 62 93 147 103 30 74 113 85 122 44 135 111 81 139 37 94 127 49 33 133 2 79 120 57 55 87 52 106 29 84 154 4 112 130 132 48 59 119 35 153 9 148 25 141 14...

output:

0 4629539 2737568 132143 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 4629539 2737568 132143 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #23:

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

input:

100 71
66 148 119 86 115 62 145 125 132 109 29 104 56 95 54 140 71 32 166 22 149 120 13 154 18 141 38 31 28 70 130 67 158 42 5 50 146 98 9 55 17 137 90 144 111 89 131 167 74 151 27 110 59 16 14 7 153 126 52 83 92 164 127 168 81 41 87 99 156 117 135 108 142 163 25 118 49 75 47 68 2 94 162 102 84 44 5...

output:

0 8300884 3762855 844061 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 8300884 3762855 844061 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #24:

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

input:

100 99
7 9 13 22 33 34 40 42 43 45 50 51 61 68 69 70 71 72 81 86 97 100 104 105 107 118 124 125 128 129 133 137 139 141 142 145 147 149 153 156 160 161 167 170 173 175 177 180 181 199 198 195 192 191 189 188 187 186 185 183 182 179 171 169 166 164 158 152 148 144 140 136 132 131 117 112 110 109 92 8...

output:

0 1889732 10411401 4330329 2318369 1437285 968805 705312 517114 395243 337291 242681 231301 168782 139223 133827 128431 89652 63153 61195 59237 57279 55321 53363 51405 34769 9452 9054 8656 8258 7860 7462 7064 6666 6268 5870 5472 5074 4676 4278 3880 3482 3084 2686 2288 1890 1492 1094 696 298 0 0 0 0 ...

result:

ok single line: '0 1889732 10411401 4330329 231... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #25:

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

input:

100 99
101 55 159 81 102 94 178 160 198 93 174 73 182 172 189 131 158 23 199 190 191 80 106 19 170 13 121 97 135 3 38 28 44 32 153 110 183 88 130 35 105 36 63 22 119 64 155 2 60 25 43 33 168 12 76 68 154 141 193 9 127 30 139 133 140 14 65 53 92 6 113 95 151 29 148 134 149 143 177 1 107 10 147 137 14...

output:

0 24997500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 24997500 0 0 0 0 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #26:

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

input:

100 100
1 5 7 9 12 14 15 17 19 21 24 26 27 28 30 35 39 41 42 43 44 46 47 48 49 51 52 53 58 59 60 61 62 63 65 67 69 70 73 74 75 78 79 82 83 87 93 97 98 100 102 103 105 106 107 109 110 111 114 116 118 120 121 122 123 125 130 132 133 134 135 137 142 143 146 147 148 149 150 152 153 155 156 161 162 163 1...

output:

0 1661452 10598504 4426144 2372720 1469860 995850 716816 538654 418320 332940 270772 223580 186638 158720 134780 117110 100206 88486 77918 67350 59692 53974 48256 42538 36820 33062 30480 27898 25316 22734 20152 17570 14988 13000 12200 11400 10600 9800 9000 8200 7400 6600 5800 5000 4200 3400 2600 180...

result:

ok single line: '0 1661452 10598504 4426144 237... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #27:

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

input:

100 100
12 13 16 28 36 91 120 133 144 74 10 14 34 62 81 115 131 167 164 132 111 73 45 31 161 160 141 138 136 117 87 85 61 50 47 2 4 24 37 107 82 77 35 46 124 151 170 171 137 130 114 112 65 59 44 27 29 52 66 70 78 106 116 126 145 153 154 200 198 197 195 194 188 186 182 176 175 174 125 32 15 19 71 113...

output:

0 4211756 10732152 4286607 2541146 914255 1147024 517389 587437 150179 115092 168663 130800 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 4211756 10732152 4286607 254... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #28:

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

input:

100 100
50 44 45 5 33 49 4 24 48 52 61 81 93 100 106 14 13 2 41 171 168 165 162 160 155 146 142 131 126 122 121 120 116 108 90 88 87 86 67 58 7 12 1 43 111 56 85 79 77 69 65 51 40 28 18 15 10 21 27 29 30 68 80 84 92 97 98 102 113 130 132 133 143 144 145 148 149 159 163 167 170 172 175 176 179 180 18...

output:

0 4530465 10558635 3889978 2255039 1214068 631888 640605 376928 288176 438617 198290 60691 58614 183879 25052 18839 18243 17647 17051 16455 57640 5700 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 4530465 10558635 3889978 225... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #29:

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

input:

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

output:

0 2119 1507 1477 1447 1417 1387 1357 1327 1297 1267 1237 1207 1085 1071 1057 1043 735 721 707 693 679 665 651 637 141 135 129 123 117 111 105 99 93 87 81 75 69 63 57 51 45 39 33 27 21 15 9 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

ok single line: '0 2119 1507 1477 1447 1417 138... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #30:

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

input:

100 100
26 61 187 179 170 177 181 50 19 57 81 37 8 13 94 60 40 51 104 100 84 108 154 82 71 178 185 99 14 134 160 52 49 68 135 45 5 46 169 158 18 33 123 85 73 76 175 157 106 137 193 191 145 164 189 67 23 95 141 130 2 63 151 75 58 89 171 101 93 148 153 91 24 43 87 25 16 149 188 182 62 97 136 120 119 1...

output:

0 12061604 13440896 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 12061604 13440896 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #31:

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

input:

100 100
28 49 51 121 107 96 40 76 160 166 164 57 10 29 35 130 104 100 46 92 127 199 131 108 102 158 187 198 146 103 2 21 48 177 165 142 81 143 157 188 53 23 12 38 88 189 180 176 149 162 168 197 196 41 5 30 69 136 27 11 4 7 65 140 123 32 17 110 137 173 153 114 112 115 159 191 167 77 19 63 79 184 178 ...

output:

0 8144636 8536056 8821808 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 8144636 8536056 8821808 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #4:

score: 1
Accepted

Test #32:

score: 1
Accepted
time: 4ms
memory: 18144kb

input:

300 300
97 322 293 313 283 13 27 353 474 32 562 75 10 317 136 482 81 309 584 138 437 48 159 339 334 356 526 357 1 352 235 242 456 461 219 66 436 565 559 284 112 20 111 23 384 51 514 134 462 124 400 261 216 76 171 202 239 238 333 179 545 527 407 539 418 588 248 440 427 376 549 15 411 355 299 365 9 12...

output:

0 264114717 638832402 110629026 24946348 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 264114717 638832402 11062902... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #33:

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

input:

243 300
182 523 513 416 89 371 114 348 361 204 484 297 148 41 379 390 507 263 541 135 172 468 139 512 391 224 71 227 489 428 314 447 306 236 251 16 136 339 104 328 214 503 385 223 349 445 151 278 217 369 408 284 294 111 528 427 189 141 438 305 510 21 208 487 44 482 486 520 4 72 495 511 471 5 156 68 ...

output:

0 825574111 415747196 86898634 7219850 3077109 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 825574111 415747196 86898634... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #34:

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

input:

258 300
544 73 24 312 326 16 277 374 445 429 86 309 466 475 235 4 35 77 294 292 377 289 439 32 219 233 74 410 174 248 29 474 325 359 360 19 339 255 398 361 193 149 296 168 221 282 60 515 70 263 136 82 80 319 412 79 478 114 486 380 40 204 177 249 502 98 192 491 501 133 436 118 100 507 352 329 484 454...

output:

0 856929210 498806907 123842325 22675308 6252900 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 856929210 498806907 12384232... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #35:

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

input:

299 300
2 6 13 14 16 21 25 28 31 34 35 38 47 48 57 58 71 88 90 96 103 133 147 148 154 156 162 163 165 175 178 180 181 191 192 196 198 199 200 201 202 206 210 222 223 229 235 236 238 239 241 242 245 250 252 257 264 265 266 272 273 289 292 298 301 302 307 313 321 325 326 334 339 342 346 349 354 356 35...

output:

0 51511682 844264201 354921351 191150672 119059120 81136411 58731939 44520779 34862685 28185071 22876625 19234107 16296614 14013018 12353551 10387636 9419994 8261449 7552356 6462077 6299509 5320464 4818491 4712273 4474711 3472826 3408296 3343766 3279236 3082691 2287081 2251701 2216321 2180941 214556...

result:

ok single line: '0 51511682 844264201 354921351... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #36:

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

input:

299 300
42 309 296 324 29 487 354 490 370 455 449 453 69 428 368 543 105 131 81 508 446 451 75 85 80 399 267 277 93 158 55 196 135 504 448 599 536 576 61 315 299 466 209 348 127 376 294 519 28 220 83 401 82 99 34 517 197 450 38 572 73 343 10 221 211 224 31 292 198 284 121 250 24 247 217 379 246 278 ...

output:

0 24977486 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 24977486 0 0 0 0 0 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #37:

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

input:

300 300
1 2 7 8 10 14 15 16 17 20 21 26 31 41 42 44 45 46 47 49 50 52 53 54 55 56 57 59 60 65 66 70 75 76 77 79 85 92 93 94 95 96 99 100 102 103 105 107 114 115 117 118 121 122 123 125 126 127 130 132 133 136 137 138 142 144 146 148 149 151 152 156 157 158 160 161 162 163 164 166 167 170 171 173 177...

output:

0 44954352 849135504 357416106 192580458 119941560 81759912 59257828 44895380 35172456 28286004 23233590 19413606 16459894 14125790 12249750 10720742 9458488 8402250 7510630 6753320 6102642 5532970 5046818 4614390 4234560 3899970 3603660 3328302 3100668 2874780 2681012 2513524 2346036 2190854 206907...

result:

ok single line: '0 44954352 849135504 357416106... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #38:

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

input:

300 300
3 65 74 169 225 242 261 267 599 597 590 589 588 585 583 580 577 569 565 541 534 424 419 415 334 323 266 162 153 144 130 67 75 122 129 155 228 240 264 280 473 464 427 384 365 260 259 252 231 203 180 140 120 106 52 59 132 196 222 226 249 250 271 287 306 310 342 351 374 389 395 398 538 553 579 ...

output:

0 154017713 859071682 353851604 189668929 112891391 90841023 48970744 42957903 28117415 26963047 23077864 30058747 6690949 7018139 8713944 9107555 12217832 6616183 4484042 8796675 7946662 2746757 3695700 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 154017713 859071682 35385160... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #39:

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

input:

300 300
21 66 76 116 137 145 162 172 267 269 286 296 297 299 318 329 336 337 339 346 375 388 393 404 406 407 411 412 419 429 431 437 443 450 459 468 471 472 480 482 487 498 499 500 503 44 57 82 98 101 115 132 148 150 151 161 168 225 230 241 251 262 301 307 315 343 364 365 387 392 401 402 413 416 425...

output:

0 178761810 848327720 356480234 172155613 111365604 74158895 49106032 44735288 29970377 23503058 25052358 12437347 10609228 8287874 18108532 3530279 10832000 2734409 4590929 5169592 6800434 6990689 1740314 1378499 6117664 912233 903590 894947 886304 7669129 709623 702158 3555766 645133 366025 362433...

result:

ok single line: '0 178761810 848327720 35648023... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #40:

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

input:

297 3
289 287 278 277 276 275 274 270 268 267 263 262 260 258 257 256 255 254 252 251 250 247 244 240 238 236 235 233 232 231 230 227 225 221 220 214 209 208 206 205 203 201 195 193 191 188 187 185 183 180 179 177 174 173 172 171 169 167 166 162 161 160 157 156 153 152 151 146 145 144 143 141 140 13...

output:

0 6519 4707 4677 4647 4617 4587 4557 4527 4497 4467 4437 4407 4377 4347 4317 4287 4257 4227 4197 4167 4137 4107 4077 4047 4017 3987 3957 3927 3897 3867 3837 3807 3777 3747 3717 3687 3657 3335 3321 3307 3293 3279 3265 3251 3237 3223 3209 3195 3181 2571 2259 2245 2231 2217 2203 2189 2175 2161 2147 213...

result:

ok single line: '0 6519 4707 4677 4647 4617 458... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #41:

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

input:

297 300
357 134 46 201 563 430 380 507 591 247 176 365 469 49 1 536 569 237 76 302 455 381 263 282 531 489 14 223 523 192 53 160 514 471 462 483 521 309 228 334 567 556 425 464 586 568 501 518 527 399 122 431 496 348 339 414 498 138 62 105 405 259 84 163 406 382 314 321 450 415 366 493 511 180 58 11...

output:

0 871042397 126980546 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 871042397 126980546 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #42:

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

input:

297 298
175 179 205 411 410 323 321 435 456 459 245 125 52 61 496 501 393 379 141 280 282 539 521 442 50 118 154 470 348 259 81 200 342 378 137 14 5 22 408 441 224 157 70 340 444 550 504 365 356 527 567 575 394 161 49 167 423 576 164 64 41 111 318 528 440 439 271 373 502 507 343 195 32 42 69 465 269...

output:

0 551908274 658779572 760827557 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 551908274 658779572 76082755... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #5:

score: 1
Accepted

Test #43:

score: 1
Accepted
time: 3ms
memory: 18244kb

input:

2000 2000
762 3148 1563 2539 1799 983 3993 1082 2912 3178 1908 2990 16 886 2973 823 913 243 357 850 2486 1588 2649 1893 1634 3691 150 996 3789 2922 2393 577 2316 924 3674 3636 910 2406 1483 1212 579 2442 1875 918 2039 928 2009 920 462 3898 1764 1592 1220 3893 1602 772 3485 1640 1940 2409 994 3201 62...

output:

0 782741918 598044376 611177039 611566102 397442558 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 782741918 598044376 61117703... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #44:

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

input:

2000 1673
1240 609 1883 36 1782 1531 1903 251 1999 977 1437 1886 268 1429 735 936 1702 97 2578 2618 1243 3279 901 3633 378 3460 2470 1636 2876 3241 1102 3652 1425 1162 3666 1084 154 1713 1183 2853 2846 1444 2786 2909 3653 2461 1778 350 3196 2373 2880 124 2175 3476 1974 2503 1411 2251 1335 930 122 20...

output:

0 268559537 19812105 640317504 15792455 57799792 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 268559537 19812105 640317504... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #45:

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

input:

2000 1666
1441 637 1376 560 3562 2064 3533 532 1284 2299 550 326 3646 221 2281 424 1713 3551 2008 2783 2050 2450 1282 878 3666 2194 3471 2136 2216 2880 3272 3087 604 53 1821 901 2921 546 1424 3022 3601 2430 1136 3602 553 705 1448 640 1956 1944 28 2633 862 1693 1435 469 3278 396 688 3084 941 721 2882...

output:

0 821880403 389814010 559129045 640855894 788656223 410256000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 821880403 389814010 55912904... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #46:

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

input:

1999 2000
3998 3996 3995 3994 3992 3981 3976 3975 3972 3966 3960 3957 3956 3951 3946 3941 3938 3937 3918 3917 3916 3914 3907 3905 3904 3903 3902 3899 3898 3895 3889 3882 3878 3873 3871 3865 3864 3863 3862 3858 3857 3855 3851 3844 3842 3833 3830 3828 3817 3814 3812 3808 3806 3801 3798 3795 3786 3785 ...

output:

0 322819402 901991339 370183561 380684617 490003199 347719149 57670952 782257615 637063143 74323909 120069504 598883638 784499412 177324382 488871602 475451750 991608853 901109246 150214907 668995309 351855027 255639454 286650107 439412442 709648395 6297224 462379918 888910354 433794634 15330438 630...

result:

ok single line: '0 322819402 901991339 37018356... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #47:

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

input:

2000 1999
255 100 595 243 2920 2412 3172 555 1633 763 3615 2202 3091 1508 2602 106 2836 2598 3559 2803 2888 1648 2677 1261 2034 688 2226 259 962 338 2884 2399 3407 3332 3532 753 2317 738 3889 826 1957 1661 3637 1409 3920 3019 3050 109 1944 1422 2043 1864 2447 951 2417 1830 3349 1716 1733 885 1316 22...

output:

0 998972007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 998972007 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #48:

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

input:

2000 2000
1 2 3 4 5 8 10 11 13 15 18 19 20 23 24 25 27 28 34 35 36 42 44 48 49 50 51 52 54 55 56 62 63 66 67 68 71 72 73 74 76 77 78 80 82 84 90 92 94 95 97 99 102 103 104 105 107 108 110 112 113 117 118 119 120 124 126 129 131 132 133 136 138 139 141 142 145 149 154 155 157 159 161 164 165 166 168 ...

output:

0 331328911 322658328 101780486 796563947 754480358 533442295 190805255 882019930 715849375 140949788 176568178 647224244 819590516 216978804 518637742 502270355 9996065 927065248 168477485 670229909 383415518 269937837 300127724 450234463 701214338 37808944 447444257 919691862 446052554 19408502 63...

result:

ok single line: '0 331328911 322658328 10178048... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #49:

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

input:

2000 2000
7 21 150 272 3935 3923 3908 3878 3875 3838 3815 3781 3748 3696 3687 3629 3605 3584 3578 3556 3529 3506 3505 3450 3442 3424 3375 3279 3168 3158 3106 3103 3040 3005 2974 2964 2867 2859 2775 2741 2705 2645 2632 2582 2490 2444 2423 2070 2051 1965 1959 1924 1901 1712 1649 1642 1583 1496 1228 86...

output:

0 599789744 960046838 652014761 923045106 842929780 297746347 588945198 991646291 472402397 611430899 356363598 123826467 259090412 484132924 97413300 171488757 485395055 896814072 111097552 752483715 493316931 803124447 847316313 155061724 230859891 843272163 98315683 572953495 412370160 796345411 ...

result:

ok single line: '0 599789744 960046838 65201476... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #50:

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

input:

2000 2000
363 339 277 211 178 96 11 22 25 252 191 127 43 49 106 210 181 124 172 183 196 3833 3832 3826 3822 3821 3816 3814 3803 3802 3796 3795 3792 3785 3779 3777 3776 3768 3762 3760 3756 3751 3750 3743 3742 3741 3740 3738 3728 3722 3720 3715 3710 3709 3707 3703 3702 3695 3693 3682 3674 3673 3672 36...

output:

0 424212907 746272157 801412057 947258506 346376970 586707732 511622325 608065183 498327245 67175539 143066644 233562290 461274723 710098714 851432841 203685384 312943026 867956337 811195825 154169614 34058905 112363371 552514484 228521264 738250455 377267993 714670220 964002383 889879208 628020452 ...

result:

ok single line: '0 424212907 746272157 80141205... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #51:

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

input:

1 2000
1458
1781 1218 675 665 798 435 984 591 1945 253 1555 930 1905 334 1550 1245 1399 347 979 651 1026 197 735 1771 183 1433 1463 454 122 671 710 1154 1621 440 781 1592 539 387 353 1983 1949 382 955 1895 1256 68 77 328 549 442 309 1704 82 699 244 1250 1494 1636 1219 283 742 50 623 1628 664 357 197...

output:

0 13562 37892 177169 550056 316765 905556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 13562 37892 177169 550056 31... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #52:

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

input:

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

output:

0 239693 257131 228614 222082 221550 221018 220486 219954 219422 218890 218358 217826 217294 216762 216230 215698 215166 214634 214102 213570 213038 212506 211974 211442 210910 210378 209846 209314 208782 208250 207718 207186 206654 206122 205590 205058 204526 203994 203462 202930 202398 201866 2013...

result:

ok single line: '0 239693 257131 228614 222082 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #53:

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

input:

2000 1999
3685 3307 1407 2869 3638 1077 983 2263 2642 810 729 795 3235 2198 893 1643 1917 231 142 1737 2181 254 12 265 3824 3148 2375 2557 2806 2801 1957 2728 3600 3488 600 1806 2273 1749 183 190 3538 3279 2231 2901 3888 3864 498 517 3110 3034 2701 3523 3669 3259 319 995 3109 2463 683 3483 3780 2313...

output:

0 314159761 684812246 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 314159761 684812246 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #54:

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

input:

1988 1982
2769 2309 2285 42 432 2099 3034 2519 2076 46 293 1641 3381 3181 3088 461 1191 2438 3041 2477 1549 844 1122 2601 2940 2518 2494 215 272 689 3776 3113 1743 1411 2109 2596 2856 2365 1100 1045 1098 2131 2163 1720 279 108 474 1286 3801 3663 3287 1111 1169 1945 2449 2118 1965 882 2396 2722 2909 ...

output:

0 437776596 641145918 158231396 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 437776596 641145918 15823139... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #6:

score: 1
Accepted

Test #55:

score: 1
Accepted
time: 18ms
memory: 18812kb

input:

8000 8000
7244 4104 4116 4733 1865 12849 14465 11794 1095 7219 5206 2781 11617 6866 9595 11983 14469 13258 2346 10847 5429 3414 4293 15825 10314 9643 14412 9550 6406 7816 13719 15736 5333 15692 12756 4329 2709 5284 5261 1707 11238 4301 13797 2131 12768 7126 9864 3229 3785 4314 8719 1117 646 8153 111...

output:

0 854868357 558678044 548935043 876628752 712304019 457416021 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 854868357 558678044 54893504... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #56:

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

input:

8000 6158
9439 6881 311 3002 9643 2872 4826 5003 6592 6743 10256 7546 10409 4960 11747 13988 7447 4484 2046 1184 11974 6293 9236 8429 2904 6808 12030 210 11416 2256 5154 10886 9062 6322 2101 9056 8135 7051 10999 4008 12248 8001 8422 6402 11876 7156 2450 2538 7040 9689 5753 12803 3628 3653 677 3367 1...

output:

0 110217560 464021370 41779422 953110312 178911487 53955493 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 110217560 464021370 41779422... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #57:

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

input:

8000 6312
4387 2168 7242 13834 2129 6920 8435 12134 42 14060 8100 5995 4880 7571 48 9398 8275 6183 9440 1089 8297 6639 1942 3092 6606 13830 13503 1730 88 10006 9822 260 841 7346 11587 12985 4457 956 4441 1187 10291 265 4140 3575 195 7476 5079 5163 2005 2079 8341 9200 398 13522 5927 9045 10078 11229 ...

output:

0 843028908 363454807 201758603 901341407 877264802 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 843028908 363454807 20175860... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #58:

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

input:

8000 7999
5 18 19 25 26 29 30 32 33 35 43 48 50 57 63 65 71 73 76 81 83 84 91 98 103 109 110 115 118 120 122 125 130 133 144 145 147 149 150 154 156 158 166 167 169 175 176 179 185 187 188 189 192 194 197 209 210 215 228 232 237 238 239 241 242 244 252 256 262 263 267 274 277 282 286 289 290 291 292...

output:

0 165271140 429025227 255048593 757013337 799655376 269920659 406936262 614900762 724133323 647857944 963292283 633052855 501108232 889798082 593664355 11134514 996594626 222065887 97564478 123806296 337645086 807433389 646013705 902779792 755756140 511375489 703988681 541678711 514835198 9867450 94...

result:

ok single line: '0 165271140 429025227 25504859... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #59:

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

input:

8000 7999
4211 8031 6657 7949 58 2415 611 13416 7243 7335 828 1940 684 14560 13492 14644 12015 14889 3710 3776 3560 5591 3422 5137 2094 8561 8508 10547 2446 11599 5033 9042 56 9942 8934 15051 11874 12044 3342 4216 4180 10059 6878 14225 7245 9389 4210 10208 1793 5731 1898 8446 7500 12451 9515 10529 6...

output:

0 976832007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 976832007 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #60:

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

input:

8000 8000
16000 15997 15993 15991 15989 15987 15986 15984 15982 15981 15980 15979 15975 15973 15971 15969 15968 15966 15965 15962 15959 15958 15953 15951 15948 15947 15946 15945 15944 15943 15940 15938 15934 15933 15932 15931 15929 15928 15927 15925 15923 15922 15921 15918 15917 15914 15911 15909 15...

output:

0 301310031 159692593 71658196 299808228 711103866 5662021 961724360 91435052 946860426 720914114 509221950 488109069 985997435 3790860 451422041 447898967 571813305 459537218 364392700 903116830 543270835 566029928 340803802 809391466 111650791 313604427 202147514 131899461 911016531 708351886 9863...

result:

ok single line: '0 301310031 159692593 71658196... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #61:

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

input:

8000 8000
54 894 902 1017 1160 1603 1676 1894 1997 2263 2357 2470 3110 3282 3467 3517 3993 4649 4674 4678 4874 5057 5078 5250 5258 5313 5322 5372 6135 6178 6219 6222 6250 6315 6403 6436 6599 6874 6894 6956 7061 7248 7360 7440 7529 8000 8005 8149 8179 8234 8314 8663 8977 9013 9109 9141 9282 9288 9302...

output:

0 246870128 677754563 384592776 102569683 48110632 457976041 738600240 88361455 214796191 172244728 226638848 326619353 204979585 821189267 760371448 160605365 548945783 545004685 811828102 517759599 173126791 288317200 772502517 467946895 459713946 95966449 395847502 832831929 937409298 696021357 1...

result:

ok single line: '0 246870128 677754563 38459277... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #62:

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

input:

8000 8000
31 73 220 280 314 592 746 275 1048 953 827 723 687 450 420 95 26 87 120 144 246 351 387 499 832 888 966 968 1026 1047 1122 1154 1180 1195 1249 1266 1495 1521 1602 1628 1722 1725 1824 1826 1896 2058 2134 2136 2168 2175 2271 2431 2531 2624 2632 2639 2681 2782 2835 2842 2846 2854 2963 2979 30...

output:

0 516371795 836866060 250702815 857791993 628906071 931172109 483157412 144251816 289651892 529779822 891224308 122323519 945959940 275857471 928586497 307622182 367106173 966028919 480803738 564877714 397822708 152476878 888629755 300385264 665664448 861868992 151153660 729262112 853218589 53017558...

result:

ok single line: '0 516371795 836866060 25070281... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #63:

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

input:

1 8000
7909
4187 730 5425 499 5883 6284 6730 4491 4521 700 3061 3288 1543 805 2776 1666 7382 7159 7499 583 3833 7764 5007 5017 1029 3307 7351 7905 4378 6415 6396 5685 994 5565 1300 6051 3780 6115 2891 5438 3364 4001 7038 3921 653 3047 7722 1497 703 5788 1464 545 6729 4020 3324 1462 1679 5169 5660 65...

output:

0 54373 181152 819570 4161100 7976130 6311005 12500670 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 54373 181152 819570 4161100 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #64:

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

input:

7 8000
1297 2432 3032 3511 4962 5455 6691
8007 8006 8005 8004 8003 8002 8001 8000 7999 7998 7997 7996 7995 7994 7993 7992 7991 7990 7989 7988 7987 7986 7985 7984 7983 7982 7981 7980 7979 7978 7977 7976 7975 7974 7973 7972 7971 7970 7969 7968 7967 7966 7965 7964 7963 7962 7961 7960 7959 7958 7957 795...

output:

0 959693 1031131 918614 894082 893550 893018 892486 891954 891422 890890 890358 889826 889294 888762 888230 887698 887166 886634 886102 885570 885038 884506 883974 883442 882910 882378 881846 881314 880782 880250 879718 879186 878654 878122 877590 877058 876526 875994 875462 874930 874398 873866 873...

result:

ok single line: '0 959693 1031131 918614 894082... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #65:

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

input:

167 8000
287 315 713 719 748 904 1025 1072 1146 1185 1189 1193 1297 1348 1354 1528 1541 1575 1591 1596 1653 1729 1842 1886 1899 2034 2036 2323 2381 2395 2552 2583 2665 2677 2710 2817 2911 2923 2962 2980 3137 3165 3198 3406 3578 3594 3685 3701 3777 3800 3850 3862 3941 4040 4194 4414 4444 4455 4487 45...

output:

0 608588515 372058262 281687980 706734622 435868745 267424438 141783183 37564848 947009092 862263770 782660693 707850725 630929815 560977548 486053153 418003093 347314667 275586778 207936318 140285858 71307975 999835133 932440481 865044197 797573684 729916370 662120273 592842494 522258308 454156820 ...

result:

ok single line: '0 608588515 372058262 28168798... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #66:

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

input:

7958 8000
5669 11566 11844 1513 278 5560 12844 6936 2081 3437 11830 9885 4455 6828 7412 4974 3428 5299 15273 1682 1137 7398 12921 3030 2242 3718 13996 4740 3719 5664 14269 8641 8573 9667 10301 7514 5133 5307 15537 11239 63 7622 7913 2444 1197 4312 7870 5624 5320 8406 10360 9822 7162 12995 15873 5570...

output:

0 226893190 993456107 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 226893190 993456107 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #67:

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

input:

8000 7960
7070 6318 4602 164 1628 11748 12209 7436 2826 2064 6605 7921 11612 11233 10057 402 1229 3514 15800 14781 12700 3412 3555 11156 14022 11305 5876 962 3480 7107 12122 11592 7782 3166 10999 11312 11771 7859 5517 1791 10370 10948 13230 5288 1322 1115 5081 5875 9300 9077 6461 191 11226 12678 131...

output:

0 750983568 610418678 330619488 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 750983568 610418678 33061948... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #7:

score: 1
Accepted

Test #68:

score: 1
Accepted
time: 194ms
memory: 20972kb

input:

70000 70000
65040 83209 46810 43228 58294 97341 24577 26778 64585 34392 121492 59033 52566 63751 20036 135689 72762 109553 67967 51787 107523 120416 95354 49900 60667 110736 115814 16626 34683 37257 119483 91814 68147 131865 33293 114111 65264 122197 57479 111482 75492 84033 133075 73321 7539 47697 ...

output:

0 729425865 587558587 738318270 638824856 674606277 837565960 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 729425865 587558587 73831827... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #69:

score: 0
Accepted
time: 143ms
memory: 22964kb

input:

70000 37583
37492 84859 41769 51158 99144 93275 97716 77493 16604 33727 732 17919 68004 11973 49869 32396 53487 18426 87225 82831 93173 103826 33624 43784 46696 51183 90418 66938 66208 34374 8115 12747 96774 105304 18455 49097 68053 21639 97420 51335 5505 71690 31124 25431 96987 67944 104957 76229 7...

output:

0 257525625 847572710 198832563 74992322 462110416 887501962 876685666 573011344 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 257525625 847572710 19883256... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #70:

score: 0
Accepted
time: 143ms
memory: 20716kb

input:

70000 38092
39337 102873 73589 46073 41900 42358 19525 58327 73666 20267 40583 82944 37612 81538 90507 84174 36904 336 20797 54757 70006 55523 76343 43643 93809 86701 84912 56362 34017 79513 43310 47620 19203 78600 27261 16949 87254 25680 100705 84955 39756 12064 98033 71353 45927 9526 23889 96150 3...

output:

0 490509254 44970860 48355354 531617660 192290496 892825075 631328038 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 490509254 44970860 48355354 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #71:

score: 0
Accepted
time: 406ms
memory: 23764kb

input:

69999 70000
3 6 7 17 18 19 25 26 27 29 31 32 36 42 43 46 47 54 56 58 61 63 65 66 71 74 78 82 84 86 89 91 94 98 106 110 116 127 132 133 135 145 152 154 156 159 160 163 164 167 168 170 171 175 180 184 186 187 188 202 205 209 221 225 227 228 229 231 232 245 255 259 262 264 271 277 280 282 284 287 289 2...

output:

0 799080686 942738558 895664176 421666573 395134704 610613272 884496771 236115264 16515247 894155601 641035379 13703884 597245548 88923331 127095753 10352585 96815231 622119194 485402804 863963203 920046878 78001662 772728687 367821234 188747819 188393680 549190848 391270082 458266447 486425276 8899...

result:

ok single line: '0 799080686 942738558 89566417... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #72:

score: 0
Accepted
time: 178ms
memory: 22428kb

input:

69999 70000
40046 53029 16921 40594 33445 78385 32451 57087 46378 109034 5543 88849 40176 41357 11888 28499 1635 127941 111929 115881 79536 128586 37843 107498 89567 118583 108774 118919 17660 31117 8509 139100 72866 111871 1180 52776 21800 112357 38783 68974 24555 137540 116856 123005 74034 75398 3...

output:

0 757500308 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 757500308 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #73:

score: 0
Accepted
time: 519ms
memory: 10200kb

input:

70000 70000
140000 139999 139998 139997 139994 139992 139991 139989 139985 139981 139980 139976 139972 139960 139958 139954 139951 139950 139946 139945 139940 139935 139933 139932 139931 139930 139924 139923 139919 139916 139915 139914 139910 139909 139908 139907 139902 139901 139900 139899 139897 1...

output:

0 212513354 425658346 137817311 774588290 902805681 931816877 629379291 800856564 698103514 189083913 863429398 868914459 558663201 576593311 289479607 938361278 968819689 266312962 989861928 341819361 902234793 964577694 56995351 274638287 586872055 947650639 337076893 169565770 330794389 181658931...

result:

ok single line: '0 212513354 425658346 13781731... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #74:

score: 0
Accepted
time: 221ms
memory: 21716kb

input:

70000 70000
100423 99832 99774 99633 99080 98481 98397 98335 96739 95802 95040 94865 94629 94595 94273 93930 93787 93431 93426 93290 93229 92939 92671 91842 91728 91168 90804 90176 89938 89897 89125 88801 88597 87919 87590 86800 86641 84595 84422 84355 83483 83284 81608 81471 80877 80156 79878 78421...

output:

0 125307938 770431940 242768136 307508446 248219374 683659766 914704883 901697576 143143060 150805625 193347096 527592524 443074930 158692225 593443446 522332151 490619831 461158408 450136654 745878652 63522427 896515339 220451392 999597532 726624475 378292061 396405125 171898334 456731050 838791426...

result:

ok single line: '0 125307938 770431940 24276813... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #75:

score: 0
Accepted
time: 394ms
memory: 23600kb

input:

70000 70000
393 436 1092 23522 23505 23498 23400 23372 23322 23312 23278 23228 23197 23156 23134 23026 23017 22992 22953 22890 22879 22832 22804 22741 22725 22715 22702 22672 22650 22630 22597 22589 22572 22532 22508 22502 22467 22460 22421 22346 22226 22219 22199 22186 22107 22078 22070 22020 22005...

output:

0 765633221 497439178 905946184 836087440 949093158 673875311 853195392 368656433 84518923 882481443 671329122 961475972 346573598 16611976 273084533 682432558 769213204 359852032 355903717 812906032 607615714 802617676 329191210 374633572 611773051 954825605 845204657 286362484 173484535 636118385 ...

result:

ok single line: '0 765633221 497439178 90594618... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #76:

score: 0
Accepted
time: 90ms
memory: 22788kb

input:

1 70000
47087
13636 1697 50640 8234 69902 17664 66833 17869 11934 9505 54973 3522 6691 9593 54602 53993 11390 5924 52845 2829 5502 45581 47147 50849 56332 23024 33642 37681 42136 35897 4546 50347 16564 23656 46490 59852 45390 69681 43094 24661 12346 37608 7431 16503 67068 68335 19441 48068 20840 654...

output:

0 476557 1587611 8216187 52957751 292763310 898115667 195917910 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 476557 1587611 8216187 52957... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #77:

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

input:

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

output:

0 8399693 9029131 8048614 7838082 7837550 7837018 7836486 7835954 7835422 7834890 7834358 7833826 7833294 7832762 7832230 7831698 7831166 7830634 7830102 7829570 7829038 7828506 7827974 7827442 7826910 7826378 7825846 7825314 7824782 7824250 7823718 7823186 7822654 7822122 7821590 7821058 7820526 78...

result:

ok single line: '0 8399693 9029131 8048614 7838... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #78:

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

input:

70000 163
1 2 4 5 7 9 10 11 12 13 17 18 19 22 24 28 30 33 34 35 44 48 49 50 53 55 57 58 64 65 66 67 68 70 71 72 73 75 77 78 79 80 81 82 83 85 86 88 89 90 92 93 94 95 96 97 100 101 102 103 104 108 110 111 112 117 119 121 122 124 125 126 127 128 130 131 141 142 143 146 148 149 150 152 153 155 158 159 ...

output:

0 99760670 182642893 534091013 315857309 598494876 703487816 170794787 819342345 560683382 351291408 185290115 59602255 939093268 831741959 728170110 659455000 546223014 469528325 404312815 339097305 240283448 165828321 102852619 39876917 976901222 913925520 850949818 754375055 692659281 630943507 5...

result:

ok single line: '0 99760670 182642893 534091013... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #79:

score: 0
Accepted
time: 106ms
memory: 21692kb

input:

70000 1143
58515 58328 58206 57810 57691 57486 57484 57032 57002 56740 56452 56381 56148 56070 56052 55625 55605 55578 55515 55391 55324 55131 55066 54994 54818 54781 53993 53853 53412 53381 53359 52891 52859 52710 52279 52195 52164 52029 51884 51670 51536 51476 51045 50995 50832 50763 50620 50446 5...

output:

0 268856871 94646110 146965578 63752085 814313013 437714184 126845121 233892467 405578395 930268400 909696690 868154570 786703634 356106865 370442288 285993229 838122617 465681464 637658822 442933048 324094917 770551555 579974485 197201411 579820512 542041758 381295211 730144928 267612467 493498264 ...

result:

ok single line: '0 268856871 94646110 146965578... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #80:

score: 0
Accepted
time: 168ms
memory: 23008kb

input:

69921 70000
6823 99708 116826 51272 5866 24811 72642 70253 13379 29714 108232 91890 57690 89799 110488 73061 33297 55239 73340 72469 52360 108769 113360 102979 92884 105646 107853 81616 43594 73466 95180 89357 38996 60098 70942 69871 1464 9377 90203 85440 61735 71248 119459 3375 1348 1580 57252 3737...

output:

0 218653558 90269244 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 218653558 90269244 0 0 0 0 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #81:

score: 0
Accepted
time: 179ms
memory: 20500kb

input:

70000 70000
103424 110177 113638 119877 84161 38053 30230 43818 61432 101616 66752 30555 9598 16434 20237 57257 51697 18553 8680 46804 51473 91881 53214 5619 244 27867 28153 127210 100225 76758 28685 80073 100449 125448 118873 41410 40282 41387 49735 120245 119695 52070 11893 15816 32549 95115 58468...

output:

0 571907736 481960188 152431870 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 571907736 481960188 15243187... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #8:

score: 1
Accepted

Test #82:

score: 1
Accepted
time: 437ms
memory: 28972kb

input:

150000 150000
58983 100778 109945 294477 253435 1447 4311 110912 171122 212851 165373 102223 98625 274188 43059 196284 13184 232675 189091 37409 150201 227081 221065 161136 37343 47901 56955 197030 149843 137335 85230 291418 55155 84454 284046 96806 7342 94155 189355 60618 87506 281679 180207 125356...

output:

0 786272003 734025130 944496383 14012224 185662564 766938345 526789852 717497194 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 786272003 734025130 94449638... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #83:

score: 0
Accepted
time: 355ms
memory: 29060kb

input:

150000 98473
49137 190209 151637 110647 8865 164207 165896 65967 102808 21917 16812 95575 18043 94359 126479 154456 207874 210197 77501 31847 234670 33772 81693 226183 200441 9865 41834 23748 168410 161980 96038 48406 103796 7344 43388 176428 239790 148168 51619 124752 24988 41747 138701 24282 11321...

output:

0 231544283 726126794 815718213 343359803 746935452 509171577 630754510 55857395 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 231544283 726126794 81571821... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #84:

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

input:

150000 110433
252370 39745 193355 38758 201271 49954 225026 168093 23774 122303 108549 48157 125009 238921 181636 228402 248780 84235 108610 4515 160118 229901 22246 205613 104522 61987 249115 147966 71743 117903 41274 97118 13434 203755 144513 160439 92906 118810 53966 111809 68329 180599 219645 39...

output:

0 284928312 294428456 281791875 926472045 266693559 583059924 831409702 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 284928312 294428456 28179187... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #85:

score: 0
Accepted
time: 1228ms
memory: 25680kb

input:

149999 150000
299999 299997 299996 299994 299992 299989 299988 299980 299979 299978 299977 299973 299971 299967 299966 299963 299960 299959 299958 299957 299955 299953 299952 299951 299950 299948 299947 299943 299942 299939 299932 299929 299927 299925 299923 299922 299921 299918 299917 299911 299908...

output:

0 891181677 108864882 641633539 465555069 985640384 409715452 109348118 218231859 105713757 492385056 375034752 774331586 374383005 586973438 905166259 904920894 804099502 797117037 891122341 436382143 204006767 783423165 292226518 687306341 657400934 51258530 525127048 124278904 736432892 489188551...

result:

ok single line: '0 891181677 108864882 64163353... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #86:

score: 0
Accepted
time: 391ms
memory: 29452kb

input:

149999 150000
108172 275401 267804 274828 30135 156869 153649 261050 19925 220484 141717 277775 20535 155459 134384 275147 187880 263427 78986 125806 63285 228655 96075 117166 58866 239259 21730 196519 170511 285590 65155 272574 169127 238021 13343 283458 76738 207077 174103 249683 126280 220847 153...

output:

0 437506244 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 437506244 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #87:

score: 0
Accepted
time: 1625ms
memory: 8424kb

input:

150000 150000
299999 299997 299996 299995 299992 299989 299988 299984 299977 299976 299975 299973 299971 299969 299968 299967 299966 299965 299964 299958 299957 299955 299954 299952 299950 299949 299945 299944 299943 299940 299932 299931 299930 299929 299927 299926 299925 299924 299922 299920 299918...

output:

0 710300086 854706139 639973344 43300170 957896514 735646239 644877269 228829049 453346242 681416912 582929512 513037452 203269256 666361265 817626515 757117434 414877702 841320902 688525680 835055798 75119314 716830972 377721770 737729688 853588625 721160625 726867150 952779191 310679101 698112823 ...

result:

ok single line: '0 710300086 854706139 63997334... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #88:

score: 0
Accepted
time: 501ms
memory: 26028kb

input:

150000 150000
297924 297909 297895 297856 297791 297755 297579 297576 297531 297501 297475 297376 297304 297127 297118 297068 296908 296901 296877 296743 296710 296567 296558 296304 296272 296214 296186 296104 296075 296056 296052 296026 295882 295856 295745 295694 295686 295684 295614 295520 295488...

output:

0 176852081 203067431 764734644 332218392 243137407 199434269 924363756 178199764 51158300 582110044 471079557 831110672 601788527 342583585 430819341 717483178 326791147 502207944 893013784 913744914 725110842 419275031 110485593 635223959 612914468 526286487 325673322 163218538 841761987 789694898...

result:

ok single line: '0 176852081 203067431 76473464... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #89:

score: 0
Accepted
time: 1148ms
memory: 29828kb

input:

150000 150000
539 311 75 585 620 693 853 1166 1800 1949 2149 2718 2792 3049 3054 3069 3133 3609 3690 3816 3886 4164 4170 4253 4405 4533 4701 4757 5053 5068 5085 530 504 1289 1646 1953 2123 2281 843 1444 1614 1697 2249 2402 2490 3219 3595 3603 3687 3795 3832 4014 4024 4101 4262 4304 4322 4363 4371 44...

output:

0 863857343 421127118 734749330 554019422 953165646 535876051 872986845 965188759 958517492 117410349 305863192 593046110 991774999 939211100 854429214 536309152 874816333 571019633 612767350 418544920 919060084 296851562 442380697 440139016 963383833 750971629 369249154 220850111 561165562 44028671...

result:

ok single line: '0 863857343 421127118 73474933... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #90:

score: 0
Accepted
time: 208ms
memory: 25024kb

input:

150000 1
72802 119569 88552 147070 69940 57593 134005 107935 22000 123326 107414 79521 82421 147276 83768 147103 12343 98224 16695 2551 92146 11773 51740 13438 43937 71957 92777 100837 98083 83549 139376 87548 143173 21120 33980 93894 124444 68567 106649 90204 48397 23638 122269 334 10672 60034 8547...

output:

0 1023513 3391035 18494152 111672298 752886285 365109931 997497723 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 1023513 3391035 18494152 111... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #91:

score: 0
Accepted
time: 22ms
memory: 8716kb

input:

150000 7
150007 150006 150005 150004 150003 150002 150001 150000 149999 149998 149997 149996 149995 149994 149993 149992 149991 149990 149989 149988 149987 149986 149985 149984 149983 149982 149981 149980 149979 149978 149977 149976 149975 149974 149973 149972 149971 149970 149969 149968 149967 1499...

output:

0 17999693 19349131 17248614 16798082 16797550 16797018 16796486 16795954 16795422 16794890 16794358 16793826 16793294 16792762 16792230 16791698 16791166 16790634 16790102 16789570 16789038 16788506 16787974 16787442 16786910 16786378 16785846 16785314 16784782 16784250 16783718 16783186 16782654 1...

result:

ok single line: '0 17999693 19349131 17248614 1... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #92:

score: 0
Accepted
time: 260ms
memory: 25880kb

input:

150 150000
146173 145828 144210 142376 141313 137929 135480 129320 129204 129191 128758 124811 124195 122892 122170 115180 112364 111298 108866 108830 107102 106541 106390 104672 101539 101332 98916 98606 95310 95003 92743 90614 87708 81240 80955 79457 78608 76201 71794 70080 64897 64426 64022 63469...

output:

0 256119712 218459504 483516986 510022921 707519584 261915948 436006469 898206259 524636323 243156600 44770034 869331366 721190351 603647821 532003176 374861281 321965861 269070441 182725795 77481527 29385915 981290310 933194698 885099086 825753624 723208711 677813027 632417343 587021659 541625975 4...

result:

ok single line: '0 256119712 218459504 48351698... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #93:

score: 0
Accepted
time: 236ms
memory: 27096kb

input:

1837 150000
392 1791 5929 16945 22578 25210 26367 28005 35414 42591 44729 45572 45607 48779 48823 53386 54442 54917 56469 60032 61991 75202 81904 84197 85559 90461 90683 91319 92348 92440 92817 93940 97836 98385 98660 100678 101656 102348 102903 106323 109076 109790 111282 113594 114041 114543 12576...

output:

0 87152045 478740341 901103720 735065487 208522005 870740893 687990264 598591572 769854612 799863284 646570080 410688092 673329856 943467479 31191167 307223059 223895552 301493686 75722075 866977298 580089128 584321717 652690746 140649528 898132715 519055680 170467547 52996814 711376439 466446807 60...

result:

ok single line: '0 87152045 478740341 901103720... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #94:

score: 0
Accepted
time: 517ms
memory: 28972kb

input:

16951 150000
461 460 473 1260 1447 2362 2543 3062 3553 4080 4439 4744 4981 5716 6087 6642 6656 6734 7117 7784 7926 7991 8675 8682 9085 9506 9705 9958 10147 10643 10771 11086 11260 11297 11403 11404 12867 13593 13620 13859 14126 14156 14501 14581 15132 15135 15149 15303 15449 15839 15928 16772 16835 ...

output:

0 32726758 926031046 582544335 838846807 431376731 296958795 913883378 810411951 69614111 931037002 987573647 105523817 488230146 288554592 277105662 557801563 126600296 371228383 764286629 266678499 196283526 699140881 292208499 891165322 816868339 865080940 346369455 250892093 543186448 615694034 ...

result:

ok single line: '0 32726758 926031046 582544335... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #95:

score: 0
Accepted
time: 394ms
memory: 30880kb

input:

150000 149276
148884 36671 7360 82693 281859 269008 212900 237812 267451 120471 43461 211551 281621 214859 104170 198106 199828 182994 36943 132751 246524 223431 106527 114320 140467 100729 8764 45310 140818 24291 4984 137170 155494 127376 126465 196682 268442 268140 26667 72781 159036 117653 109661...

output:

0 499190195 837649372 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 499190195 837649372 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #96:

score: 0
Accepted
time: 416ms
memory: 25868kb

input:

149120 150000
1008 159107 162297 173005 145896 25671 15324 16859 131312 217373 157891 122499 102105 186065 225361 269376 33715 21522 9431 184304 277888 284023 134397 98783 42099 53346 85302 169439 109842 60189 11814 77689 82798 225048 192994 169962 123029 154156 176431 249807 245894 125725 66884 747...

output:

0 993106493 572379302 481819556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 993106493 572379302 48181955... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #9:

score: 1
Accepted

Test #97:

score: 1
Accepted
time: 697ms
memory: 34816kb

input:

230000 230000
53349 24839 147164 179787 169500 138524 104308 71283 404918 183895 337401 419461 119619 389931 304997 360563 177306 435849 94845 192364 358356 159738 442086 88126 354608 167743 320160 221916 402274 207329 178240 316555 328700 13950 214332 286314 232082 56917 406912 123163 219788 153687...

output:

0 63850664 776309140 993968860 736439398 619284906 174072396 430009977 171014375 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 63850664 776309140 993968860... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #98:

score: 0
Accepted
time: 646ms
memory: 35984kb

input:

230000 208554
111431 122146 359001 361598 303602 390516 320261 248391 435827 397136 225846 277737 314389 90951 122569 194814 258738 161930 350416 415560 302605 137287 271360 73450 380952 363247 396049 94243 305655 349235 185477 107263 392019 167507 10404 370585 102874 3252 327229 414792 49948 64010 ...

output:

0 255793830 502876746 688342008 641311168 892358209 42519419 481120666 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 255793830 502876746 68834200... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #99:

score: 0
Accepted
time: 578ms
memory: 34992kb

input:

155970 230000
238836 369745 237946 308148 221567 223399 109171 69823 248113 74952 21653 95733 139177 175320 27945 106744 170422 170548 59650 74338 4717 261972 186732 54776 379808 105549 329744 108113 151488 86992 186859 232853 220176 354757 177176 108809 292192 309471 259995 247322 300370 356002 187...

output:

0 310190991 990243603 758514237 7254113 112881885 470728367 313495959 543719858 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 310190991 990243603 75851423... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #100:

score: 0
Accepted
time: 2313ms
memory: 32856kb

input:

230000 229999
3 10 14 15 16 20 22 32 38 39 44 47 48 53 62 67 70 79 80 82 83 84 86 91 93 95 97 100 102 103 110 117 123 124 129 149 151 155 157 160 166 167 174 182 183 187 189 200 206 209 212 214 215 217 219 223 228 231 236 240 250 253 255 256 260 276 278 279 280 282 285 286 290 292 293 294 296 299 30...

output:

0 306002899 940407451 988720379 884500880 190858438 420124356 249690557 557792834 753876409 336310849 537225940 891067083 981439699 701927684 595872905 53264960 603678222 307621611 789547789 964950524 887078124 129808995 689077958 667114906 973519153 638596795 487830530 699865038 998456462 354155317...

result:

ok single line: '0 306002899 940407451 98872037... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #101:

score: 0
Accepted
time: 605ms
memory: 37852kb

input:

229999 230000
185283 490 120380 52494 279072 96734 427874 33877 398135 372120 407384 47785 388465 243462 322622 87789 206690 34731 91977 41521 309048 78453 159574 4796 367057 135829 314749 53531 360471 305181 319589 138323 455994 442154 443214 195435 429331 353926 386670 72730 207160 66140 381128 22...

output:

0 557534377 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 557534377 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #102:

score: 0
Accepted
time: 3091ms
memory: 12868kb

input:

230000 230000
460000 459999 459998 459995 459992 459990 459989 459988 459986 459982 459981 459979 459978 459977 459976 459974 459969 459968 459964 459963 459962 459961 459959 459958 459955 459954 459951 459950 459949 459948 459944 459943 459942 459939 459938 459936 459935 459934 459933 459930 459928...

output:

0 740886860 742030072 349023853 275517324 570368321 30418708 734395423 929973083 347729162 274538335 630752910 174233647 262844770 8008230 964372765 130438568 819115676 396843959 651777269 60283666 309790077 295797869 888744918 771510339 61488698 882432862 852002830 110959898 165188302 747216070 737...

result:

ok single line: '0 740886860 742030072 34902385... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #103:

score: 0
Accepted
time: 813ms
memory: 29664kb

input:

230000 230000
602 1433 1568 3121 3405 3940 4606 4833 5290 7546 7917 9486 9636 10670 11467 11494 12072 13925 14654 15900 21627 23021 24009 24491 26234 27133 28446 28654 33678 33820 33891 34045 35635 35664 37591 37829 37880 39478 39518 39865 40170 42175 43387 43529 44484 47210 47885 51147 51430 53074 ...

output:

0 763419668 225876632 887255051 563442918 936163852 346636790 226992570 468567908 449038079 72605764 933006578 932059164 402653745 756120074 387765634 161718675 262184594 98598767 51443342 808761229 469346404 102983148 738628490 160765789 864350053 448195461 24007504 353420603 530084520 148483397 56...

result:

ok single line: '0 763419668 225876632 88725505... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #104:

score: 0
Accepted
time: 1890ms
memory: 33400kb

input:

230000 230000
2098 1718 1215 1200 376 1740 2566 2693 2865 2968 3095 26279 26232 26200 26051 25977 25974 25886 25830 25723 25704 25635 25589 25581 25560 25545 25483 25435 25307 25285 25164 25126 25097 25085 25082 25012 24976 24936 24805 24782 24772 24769 24635 24534 24515 24504 24471 24454 24438 2443...

output:

0 76223474 758339395 219086643 731403520 970622411 16377719 97294715 16206817 672698291 876153250 579135666 702463337 297395813 193641728 843172818 886382992 745287007 752523096 5270753 591412642 335602912 941406194 989691721 401031085 64666746 47628325 177988664 909508501 38665996 828236569 5872309...

result:

ok single line: '0 76223474 758339395 219086643... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #105:

score: 0
Accepted
time: 337ms
memory: 34680kb

input:

1 230000
56652
51468 7202 169901 141666 168446 42609 163980 110733 38895 137870 52964 220035 185114 215550 211441 173955 25209 204436 156675 125582 16301 201079 151592 133120 83310 176865 18322 64736 112872 125749 59727 125908 50028 111435 169723 8710 154048 31850 100951 33178 150408 63838 150125 14...

output:

0 1565835 5296404 27930298 185797687 641002807 447471126 634958962 506091713 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 1565835 5296404 27930298 185... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #106:

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

input:

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

output:

0 27599693 29669131 26448614 25758082 25757550 25757018 25756486 25755954 25755422 25754890 25754358 25753826 25753294 25752762 25752230 25751698 25751166 25750634 25750102 25749570 25749038 25748506 25747974 25747442 25746910 25746378 25745846 25745314 25744782 25744250 25743718 25743186 25742654 2...

result:

ok single line: '0 27599693 29669131 26448614 2... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #107:

score: 0
Accepted
time: 463ms
memory: 28864kb

input:

177 230000
222925 220481 217197 216818 214597 212612 209279 199212 198194 194875 192477 187037 182899 179168 173338 170192 162425 160066 158158 148922 148400 146882 146525 142630 141637 140310 134157 131825 131527 130207 128968 128402 128047 126276 126029 124483 122183 121465 118677 115763 111142 11...

output:

0 770607977 544550028 511758885 968079559 850605664 290165279 201986038 910900592 926602820 290038808 815383958 326007244 56960341 763993982 557044028 280635850 170742920 980351731 757761122 659367792 560974462 462581132 205030178 113996656 22963134 931929619 840896097 749862575 658829053 487296221 ...

result:

ok single line: '0 770607977 544550028 51175888... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #108:

score: 0
Accepted
time: 393ms
memory: 30700kb

input:

1884 230000
683 2372 4404 20114 21194 23823 33893 35161 41903 45718 46379 60845 64640 73101 75317 77454 78209 80374 95177 97488 100294 104498 110404 116587 118320 222677 222193 222082 220808 220713 219493 217295 216735 215797 215122 214554 214268 213667 212584 208641 207914 206218 205235 204170 1991...

output:

0 639390181 477767461 29100575 88361397 872258008 400496831 646714890 699308466 748893834 246950481 589954419 865812556 759265067 822229482 974753712 940993974 780623787 258329545 50932691 304339051 121607467 90374853 469537747 767567698 853571249 458104089 942091115 918315776 195676672 967607496 73...

result:

ok single line: '0 639390181 477767461 29100575... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #109:

score: 0
Accepted
time: 1025ms
memory: 28792kb

input:

12098 230000
3486 2690 936 632 93348 93175 93171 93120 92773 92247 92068 92013 91760 91738 91702 91691 91673 91653 91501 91475 91364 91323 91203 91191 91069 91017 90928 90620 90608 90534 89914 89835 89575 89533 89501 89388 89013 88999 88944 88847 87851 87680 87564 87526 87519 87450 87430 87256 87118...

output:

0 231965770 517894061 637153926 725329188 518991319 387299460 416577375 104309490 154306316 876502937 785481386 212979169 726915193 888081524 600274173 331646815 297573095 460944584 135670087 908654115 874212255 119692942 280491622 723426302 948763538 712296859 79072938 245540325 765452037 323096520...

result:

ok single line: '0 231965770 517894061 63715392... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #110:

score: 0
Accepted
time: 619ms
memory: 36540kb

input:

228926 230000
376427 319366 116523 279562 393022 102545 59287 133073 190981 141362 129188 223630 428050 410978 26995 219317 451177 444461 119194 249956 354076 191034 174100 253336 291968 198033 15961 199597 280824 99270 13123 82218 410982 410679 18478 76906 352079 337624 1887 57975 265779 198550 939...

output:

0 693437742 313894406 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 693437742 313894406 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #111:

score: 0
Accepted
time: 654ms
memory: 34084kb

input:

230000 230000
214740 168688 126890 103588 183939 293999 316339 188725 112592 102929 161024 228871 309808 302003 286629 184460 187323 267583 306460 270673 254488 128775 158501 215906 382952 341656 294383 12256 148343 171926 443959 399311 359438 284037 355766 356586 421600 404239 294008 197883 263036 ...

output:

0 706278453 737208095 521463154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 706278453 737208095 52146315... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Subtask #10:

score: 1
Accepted

Test #112:

score: 1
Accepted
time: 918ms
memory: 38836kb

input:

300000 300000
416773 186118 31247 38672 389294 339767 320108 250609 228574 232436 344414 316497 334835 318936 3172 393368 210300 145194 50617 423649 504469 6918 54400 485308 99748 556889 171790 488017 290307 560629 126324 57741 457051 257487 336091 524134 571207 573790 18672 361275 414336 343166 314...

output:

0 912421684 449987593 334615791 789752949 514619435 715441616 758744757 930015281 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 912421684 449987593 33461579... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #113:

score: 0
Accepted
time: 899ms
memory: 41988kb

input:

300000 286610
523496 417446 528533 401160 580886 476260 225874 256916 295292 401762 487605 526417 394033 116410 116123 182524 19164 215864 344069 534410 400640 65822 347255 314788 495349 147192 387303 364805 456883 218033 419501 8074 317363 61314 388503 321615 555497 148598 97776 332337 117105 29792...

output:

0 787021165 522086776 796676482 495530732 903657826 974058126 671492222 281044021 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 787021165 522086776 79667648... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #114:

score: 0
Accepted
time: 844ms
memory: 41408kb

input:

248896 300000
303529 436909 25683 284338 404595 137230 201285 251101 373357 391335 307875 276211 402556 534117 379707 488076 377196 270671 82650 132777 33684 140603 542579 329885 109926 42579 321110 292667 490725 532246 139644 298540 541052 235016 292094 326339 30623 538678 163972 514469 173898 2003...

output:

0 733898484 41285951 14922934 991247253 166335730 512413244 783690853 760985768 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 733898484 41285951 14922934 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #115:

score: 0
Accepted
time: 3415ms
memory: 35512kb

input:

300000 299999
599025 599023 599013 599012 599006 598993 598987 598986 598982 598979 598974 598973 598962 598955 598954 598950 598947 598945 598942 598941 598939 598935 598927 598925 598924 598920 598914 598913 598911 598909 598900 598899 598898 598893 598891 598876 598862 598860 598857 598855 598854...

output:

0 385676666 744587410 257775354 130656230 678942007 452844176 634722397 931548410 216025129 923822879 376243984 50332442 361298429 514277815 950974701 581626851 201459821 465018921 518613640 459732590 209018767 855814557 850726562 597573638 174613420 785472948 298313551 199514933 88850858 566232579 ...

result:

ok single line: '0 385676666 744587410 25777535... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #116:

score: 0
Accepted
time: 806ms
memory: 46948kb

input:

299999 300000
4524 562572 277846 500506 270976 409839 156449 404859 255019 268511 150797 395146 282891 338340 1160 491580 409328 447877 18148 106440 76302 127812 115881 487640 458356 498248 302037 320564 123457 429040 425291 461106 173393 220195 138785 408796 375722 499155 33936 213508 182384 580780...

output:

0 500099386 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 500099386 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #117:

score: 0
Accepted
time: 4593ms
memory: 15156kb

input:

300000 300000
600000 599999 599996 599994 599989 599988 599987 599984 599979 599978 599977 599974 599973 599972 599969 599968 599966 599965 599964 599962 599960 599957 599956 599955 599953 599951 599949 599942 599940 599939 599938 599937 599936 599935 599932 599930 599929 599926 599915 599913 599912...

output:

0 684350324 711168033 241493934 185054594 812523533 751470409 599754817 78032772 27265105 309901115 726437543 222846104 993583316 777324705 564094557 301722482 253532683 333402137 344858605 503907011 567992864 115981818 334200483 892120008 507369848 548887840 716101310 35043959 292917581 197331897 7...

result:

ok single line: '0 684350324 711168033 24149393... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #118:

score: 0
Accepted
time: 1088ms
memory: 36348kb

input:

300000 300000
188678 187522 183250 180600 178715 177470 176123 174878 172809 172396 167946 167188 166295 164613 164448 164057 162110 160064 156493 155858 155334 154803 154601 153085 151589 150665 148273 148256 145793 143163 141651 140470 140104 138791 138387 137671 137252 137158 137094 136543 135077...

output:

0 883294687 164602593 784485320 513385392 952841334 74518436 435034479 137406042 310860593 236192736 767865791 815346912 363724691 892337920 549285353 687426922 334430884 908074532 53288592 917835243 396474752 534909640 152049182 144935547 840686581 562316950 141317759 516205242 688157751 902956050 ...

result:

ok single line: '0 883294687 164602593 78448532... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #119:

score: 0
Accepted
time: 3917ms
memory: 45632kb

input:

300000 300000
4651 4604 4579 4150 4044 3635 3539 3138 2834 2525 2690 3258 3908 3464 3409 2893 1981 1599 1551 388 105 550 2260 44 243 1275 1995 2141 2172 1398 1381 1157 788 863 1771 1813 2103 2645 2777 3435 3766 3947 4008 4037 4170 4192 4411 4794 4821 4873 5301 5368 5609 5650 6020 6116 6484 6520 6573...

output:

0 715989521 307951884 115138924 996010477 206819030 274732365 624748842 978482514 664029739 233925185 431444259 120441724 977990121 60447338 562326445 764588021 265331033 703969780 853820461 994268697 415288270 848694671 420965016 170380848 475198592 341618320 170009763 298222756 720488145 867397376...

result:

ok single line: '0 715989521 307951884 11513892... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #120:

score: 0
Accepted
time: 445ms
memory: 36232kb

input:

300000 1
201479 95900 62819 103650 35736 246465 268676 114091 162367 281135 290350 56556 24935 35537 70543 152790 139088 183510 93034 22484 28143 232330 128309 171480 57965 186048 10596 127187 246527 84541 64193 20169 47563 141308 245978 123373 164867 239766 55620 37603 290563 151211 93498 167474 27...

output:

0 2044869 6851533 34625196 219704104 536579037 840151595 360193365 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 2044869 6851533 34625196 219... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #121:

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

input:

7 300000
94220 102501 140754 143815 194855 212655 227988
300007 300006 300005 300004 300003 300002 300001 300000 299999 299998 299997 299996 299995 299994 299993 299992 299991 299990 299989 299988 299987 299986 299985 299984 299983 299982 299981 299980 299979 299978 299977 299976 299975 299974 29997...

output:

0 35999693 38699131 34498614 33598082 33597550 33597018 33596486 33595954 33595422 33594890 33594358 33593826 33593294 33592762 33592230 33591698 33591166 33590634 33590102 33589570 33589038 33588506 33587974 33587442 33586910 33586378 33585846 33585314 33584782 33584250 33583718 33583186 33582654 3...

result:

ok single line: '0 35999693 38699131 34498614 3... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #122:

score: 0
Accepted
time: 460ms
memory: 32516kb

input:

123 300000
296168 293808 291727 290816 288105 287307 283830 265034 264070 261958 253752 253180 247017 239243 238663 238540 237380 233231 221909 217493 216105 214925 204531 190898 190414 182700 181039 170997 168145 166273 163674 156883 149592 131752 129828 123220 118402 116843 107852 107194 106428 10...

output:

0 443154641 202282761 743686408 113444702 49244443 507109462 606329697 45730962 677123384 410511739 158898624 68681861 872866622 797649273 759631303 613614566 547996839 519578677 491160515 462742353 361724665 301506680 278488446 255470212 232451978 209433744 186415510 163397276 140379042 117360808 5...

result:

ok single line: '0 443154641 202282761 74368640... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #123:

score: 0
Accepted
time: 526ms
memory: 33120kb

input:

1598 300000
23326 32843 46910 250282 248815 243845 231140 230806 225779 225119 222411 218836 214292 205762 203303 168701 151022 150976 145382 140302 138632 136626 109566 107006 102472 101761 101507 95295 91843 77955 57855 53976 45298 45278 34692 12462 19571 28286 43863 67668 88753 89580 90853 97806 ...

output:

0 271253710 746053148 343496996 707435261 368154403 996825233 925344105 219000223 353624676 986524523 738197512 600931586 961636800 168911074 962057163 259005876 538081026 184997596 369241402 173160222 248126029 755675695 411761006 128751889 216651012 318210917 383384249 772029710 49332681 409549749...

result:

ok single line: '0 271253710 746053148 34349699... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #124:

score: 0
Accepted
time: 1344ms
memory: 34176kb

input:

11045 300000
2151 4654 8305 9894 10272 13747 16502 18520 2800 631 1124 4541 8602 9904 11077 12944 14293 8859 8693 5552 4338 9092 5363 5477 5557 6717 10538 10707 12841 14539 17967 20871 22600 24908 25016 3200 2313 2301 5178 5822 116664 116403 116181 115908 115732 115582 115555 115524 115208 114277 11...

output:

0 195480427 444741913 319457944 378069281 907688893 659469341 225093949 746284288 666900190 161894891 239607243 426014221 499210705 923258565 503786955 795232015 684873025 266966288 777709467 644728433 337162567 683961256 634078586 421216437 998496842 50688921 761702864 545166213 422786970 689958795...

result:

ok single line: '0 195480427 444741913 31945794... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #125:

score: 0
Accepted
time: 840ms
memory: 40508kb

input:

298057 297454
516710 56096 1717 51826 316855 297601 116859 262931 432075 134455 29786 133417 356588 315834 199344 246391 334975 79887 71024 140857 393950 376362 162235 206668 208562 119401 83451 144388 210401 115382 42616 259850 500042 263045 11604 324145 516286 512324 420788 483985 538119 171179 53...

output:

0 395437689 591859284 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 395437689 591859284 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #126:

score: 0
Accepted
time: 875ms
memory: 39844kb

input:

300000 298683
507440 419132 176766 120564 128328 366272 499913 450329 319101 236657 385461 426312 445872 130322 85110 18938 32969 104886 592739 578081 313007 23450 136304 484146 541606 510310 125258 8670 58147 298783 410513 238228 222950 47064 107934 376340 471014 401088 315352 8302 328198 376342 50...

output:

0 633420358 176026549 767990658 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 633420358 176026549 76799065... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Extra Test:

score: 0
Extra Test Passed