P20470 [HackerEarth] View Russian Translation
提高-
题目描述

View Russian Translation

The great Charzeh is playing a game with Joffrey Baratheon. There are n knights in seven kingdoms. i-th knight has strength equal to ai (0 ≤ ai < m). There are also n+m-1 numbers f0, f1, ..., fn+m-2 on the walls of black castle.

"The game" consists of two turns. In the first turn, Charzeh chooses a permutation of numbers 0, 1, ..., n-1 like p0, p1, ..., pn-1.

In the second turn Joffrey chooses and integer i (0 ≤ i < n) and then beheads fpi + ai random residents of Winterfell. Charzeh is kind and Joffrey is cruel. That's why Charzeh tries to minimize and Joffrey tries to maximize the number beheaded people.

If they both play optimally, how many people will die?

Input
The first line of input contains two integers n and m (1 ≤ n, m ≤ 300).

The second line contains n integers a0, a1, ..., an-1 separated by spaces (0 ≤ ai < m).

The third line contains n+m-1 integers f0, f1, ..., fn+m-2 separated by spaces (1 ≤ fi ≤ 10^9).

Output
Print the number of beheaded people at the end of the game.

Note
This problem doesn't require any Game of Thrones knowledge. They're just some random words ;)

SAMPLE INPUT
4 10
7 0 9 1
5 61 53 6 7 72 75 42 5 79 91 5 16

SAMPLE OUTPUT
7

输入格式

见题面

输出格式

见题面

样例输入
85 85 10 9 68 15 76 57 51 47 28 27 6 4 62 53 62 51 79 45 27 82 63 63 19 9 73 62 23 35 76 19 73 10 67 14 75 8 34 31 28 63 34 73 56 14 76 39 76 17 30 51 39 8 83 8 36 33 31 59 1 59 4 54 13 56 79 59 54 73 59 28 24 55 8 25 66 1 73 32 38 21 31 3 10 17 27 150 453 73 793119138 493 294238188 108309793 495 512 336 146952564 151 121197531 130525542 802358298 540 247 310 451459466 220 440 986497669 664148894 474093581 342 136 450 58 243 251852608 480419423 205 229 260 232 435 83 254 990581191 536787731 89 327 339 640842982 154 329 50 678423672 815231495 262 920484124 209 250361188 485 54 503 102 278 343 9927485 764139432 152 341863506 401 420956753 212 448 5 98 255 45 518 57 186 251 503 321 4 534 173473000 307 159 513 109801701 35 305 311 499 311 91 369 37389756 4 441 356 466 9 428 36 202 939847614 482 347 216 588417918 487 429 40 225310154 112 31 49 66 119 300 287 765285950 6 419 166 206 78 125 769108681 20 460 290222779 251 241 400 483 89 903113441 219 156 459 346 380 375 150 477 882930951 914895387 522 466703323 463 411 528 41 428 407 455 863240744 406 207429412 489 181 822288679 594433319 142973380 742908637 321 161 525 119732616 391 269 791360569 131552367
样例输出
1