{"raw_statement":[{"iden":"statement","content":"On a number axis n teleports are located in the points ti and m bonuses are located in the points bj. Being in the same point with a teleport, one can instantly relocate to another point with the teleport. Being in the same point with a bonus, one can instantly get this bonus.\n\nYou are in the point t1 and must collect all the bonuses, and then return back to the point t1. You can move along the number axis in any direction at the speed 1. How much time will it take to collect all the bonuses?\n\nThe first line contans two integers n and m separated by a space (1 ≤ n, m ≤ 200000) — the number of teleports and the number of bonuses, correspondingly.\n\nThe second line contains n integers ti separated by a space ( - 109 ≤ ti ≤ 109, ti ≤ ti + 1) — coordinates of the teleports in non-decreasing order.\n\nThe third line contains m integers bj separated by a space ( - 109 ≤ bj ≤ 109, bj ≤ bj + 1) — coordinates of the bonuses in non-decreasing order.\n\nOutput a single integer — the minimal time required to collect all the bonuses.\n\n"},{"iden":"input","content":"The first line contans two integers n and m separated by a space (1 ≤ n, m ≤ 200000) — the number of teleports and the number of bonuses, correspondingly.The second line contains n integers ti separated by a space ( - 109 ≤ ti ≤ 109, ti ≤ ti + 1) — coordinates of the teleports in non-decreasing order.The third line contains m integers bj separated by a space ( - 109 ≤ bj ≤ 109, bj ≤ bj + 1) — coordinates of the bonuses in non-decreasing order."},{"iden":"output","content":"Output a single integer — the minimal time required to collect all the bonuses."},{"iden":"examples","content":"Input2 40 10-1 1 9 11Output8Input2 20 104 6Output10Input1 11000000000-1000000000Output4000000000"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ S $ be a string of length $ n $, where $ 1 \\leq n \\leq 10^5 $, consisting of lowercase English letters.  \nLet $ X $ be a string of the same length as $ S $, also consisting of lowercase English letters.  \n\n**Cost Function**  \nThe cost of $ S $ with respect to $ X $ is defined as:  \n$$\n\\text{cost}(S, X) = \\sum_{i=1}^{n} | \\text{ord}(S_i) - \\text{ord}(X_i) |\n$$  \nwhere $ \\text{ord}(c) $ denotes the ASCII value of character $ c $.  \n\n**Objective**  \nFind the string $ X $ that minimizes $ \\text{cost}(S, X) $.  \nIf multiple such $ X $ exist, choose the lexicographically smallest one.","simple_statement":"Find the smallest character in the string and print it.","has_page_source":false}