Cody

# Problem 2174. Minimal cost

Solution 1967350

Submitted on 8 Oct 2019 by Cao Van Cuong
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
W=200 L=400 CL=3 CW=6 y_correct = 2239; assert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))

W = 200 L = 400 CL = 3 CW = 6 ssh = 1 ssh = 2 ssh = 3 ssh = 4 ssh = 5 ssh = 6 ssh = 7 ssh = 8 ssh = 9 ssh = 10 ssh = 11 ssh = 12 ssh = 13 ssh = 14 ssh = 15 ssh = 16 ssh = 17 ssh = 18 ssh = 19 ssh = 20 ssh = 21 ssh = 22 ssh = 23 ssh = 24 ssh = 25 ssh = 26 ssh = 27 ssh = 28 ssh = 29 ssh = 30 ssh = 31 ssh = 32 ssh = 33 ssh = 34 ssh = 35 ssh = 36 ssh = 37 ssh = 38 ssh = 39 ssh = 40 ssh = 41 ssh = 42 ssh = 43 ssh = 44 ssh = 45 ssh = 46 ssh = 47 ssh = 48 ssh = 49 ssh = 50 ssh = 51 ssh = 52 ssh = 53 ssh = 54 ssh = 55 ssh = 56 ssh = 57 ssh = 58 ssh = 59 ssh = 60 ssh = 61 ssh = 62 ssh = 63 ssh = 64 ssh = 65 ssh = 66 ssh = 67 ssh = 68 ssh = 69 ssh = 70 ssh = 71 ssh = 72 ssh = 73 ssh = 74 ssh = 75 ssh = 76 ssh = 77 ssh = 78 ssh = 79 ssh = 80 ssh = 81 ssh = 82 ssh = 83 ssh = 84 ssh = 85 ssh = 86 ssh = 87 ssh = 88 ssh = 89 ssh = 90 ssh = 91 ssh = 92 ssh = 93 ssh = 94 ssh = 95 ssh = 96 ssh = 97 ssh = 98 ssh = 99 ssh = 100 ssh = 101 ssh = 102 ssh = 103 ssh = 104 ssh = 105 ssh = 106 ssh = 107 ssh = 108 ssh = 109 ssh = 110 ssh = 111 ssh = 112 ssh = 113 ssh = 114 ssh = 115 ssh = 116 ssh = 117 ssh = 118 ssh = 119 ssh = 120 ssh = 121 ssh = 122 ssh = 123 ssh = 124 ssh = 125 ssh = 126 ssh = 127 ssh = 128 ssh = 129 ssh = 130 ssh = 131 ssh = 132 ssh = 133 ssh = 134 ssh = 135 ssh = 136 ssh = 137 ssh = 138 ssh = 139 ssh = 140 ssh = 141 ssh = 142 ssh = 143 ssh = 144 ssh = 145 ssh = 146 ssh = 147 ssh = 148 ssh = 149 ssh = 150 ssh = 151 ssh = 152 ssh = 153 ssh = 154 ssh = 155 ssh = 156 ssh = 157 ssh = 158 ssh = 159 ssh = 160 ssh = 161 ssh = 162 ssh = 163 ssh = 164 ssh = 165 ssh = 166 ssh = 167 ssh = 168 ssh = 169 ssh = 170 ssh = 171 ssh = 172 ssh = 173 ssh = 174 ssh = 175 ssh = 176 ssh = 177 ssh = 178 ssh = 179 ssh = 180 ssh = 181 ssh = 182 ssh = 183 ssh = 184 ssh = 185 ssh = 186 ssh = 187 ssh = 188 ssh = 189 ssh = 190 ssh = 191 ssh = 192 ssh = 193 ssh = 194 ssh = 195 ssh = 196 ssh = 197 ssh = 198 ssh = 199 ssh = 200 ssh = 201 ssh = 202 ssh = 203 ssh = 204 ssh = 205 ssh = 206 ssh = 207 ssh = 208 ssh = 209 ssh = 210 ssh = 211 ssh = 212 ssh = 213 ssh = 214 ssh = 215 ssh = 216 ssh = 217 ssh = 218 ssh = 219 ssh = 220 ssh = 221 ssh = 222 ssh = 223 ssh = 224 ssh = 225 ssh = 226 ssh = 227 ssh = 228 ssh = 229 ssh = 230 ssh = 231 ssh = 232 ssh = 233 ssh = 234 ssh = 235 ssh = 236 ssh = 237 ssh = 238 ssh = 239 ssh = 240 ssh = 241 ssh = 242 ssh = 243 ssh = 244 ssh = 245 ssh = 246 ssh = 247 ssh = 248

2   Pass
W=100 L=200 CL=2 CW=3 y_correct = 623; assert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))

W = 100 L = 200 CL = 2 CW = 3 ssh = 1 ssh = 2 ssh = 3 ssh = 4 ssh = 5 ssh = 6 ssh = 7 ssh = 8 ssh = 9 ssh = 10 ssh = 11 ssh = 12 ssh = 13 ssh = 14 ssh = 15 ssh = 16 ssh = 17 ssh = 18 ssh = 19 ssh = 20 ssh = 21 ssh = 22 ssh = 23 ssh = 24 ssh = 25 ssh = 26 ssh = 27 ssh = 28 ssh = 29 ssh = 30 ssh = 31 ssh = 32 ssh = 33 ssh = 34 ssh = 35 ssh = 36 ssh = 37 ssh = 38 ssh = 39 ssh = 40 ssh = 41 ssh = 42 ssh = 43 ssh = 44 ssh = 45 ssh = 46 ssh = 47 ssh = 48 ssh = 49 ssh = 50 ssh = 51 ssh = 52 ssh = 53 ssh = 54 ssh = 55 ssh = 56 ssh = 57 ssh = 58 ssh = 59 ssh = 60 ssh = 61 ssh = 62 ssh = 63 ssh = 64 ssh = 65 ssh = 66 ssh = 67 ssh = 68 ssh = 69 ssh = 70 ssh = 71 ssh = 72 ssh = 73 ssh = 74 ssh = 75 ssh = 76 ssh = 77 ssh = 78 ssh = 79 ssh = 80 ssh = 81 ssh = 82 ssh = 83 ssh = 84 ssh = 85 ssh = 86 ssh = 87 ssh = 88 ssh = 89 ssh = 90 ssh = 91 ssh = 92 ssh = 93 ssh = 94 ssh = 95 ssh = 96 ssh = 97 ssh = 98 ssh = 99 ssh = 100 ssh = 101 ssh = 102 ssh = 103 ssh = 104 ssh = 105 ssh = 106 ssh = 107 ssh = 108 ssh = 109 ssh = 110 ssh = 111 ssh = 112 ssh = 113 ssh = 114 ssh = 115 ssh = 116 ssh = 117 ssh = 118 ssh = 119 ssh = 120 ssh = 121 ssh = 122 ssh = 123 ssh = 124

3   Pass
W=48 L=36 CL=3 CW=5 y_correct = 300; assert(isequal(floor(minimumdist(W,L,CW,CL)),y_correct))

W = 48 L = 36 CL = 3 CW = 5 ssh = 1 ssh = 2 ssh = 3 ssh = 4 ssh = 5 ssh = 6 ssh = 7 ssh = 8 ssh = 9 ssh = 10 ssh = 11 ssh = 12 ssh = 13