{"raw_statement":[{"iden":"problem statement","content":"Takahashi runs AtCoder store. $N$ customers visit the store, and $M$ items are sold in the store. The motivation of the $i$\\-th $(1\\leq i\\leq N)$ customer is $B _ i$. The value of the $j$\\-th $(1\\leq j\\leq M)$ item is $C _ j$.\nTakahashi sets a price for each item. The $i$\\-th customer buys one $j$\\-th item if and only if its price $P _ j$ satisfies:\n\n*   $B _ i+C _ j\\geq P _ j$.\n\nFor each $j=1,2,\\ldots,M$, find the gross sale of the $j$\\-th item when Takahashi sets the price so that the sale is maximized. The gross sale of the $j$\\-th item is defined as the product of $P _ j$ and the number of customers that buys the $j$\\-th item."},{"iden":"constraints","content":"*   $1\\leq N\\leq2\\times10^5$\n*   $1\\leq M\\leq2\\times10^5$\n*   $0\\leq B _ i\\leq10^9\\quad(1\\leq i\\leq N)$\n*   $0\\leq C _ i\\leq10^9\\quad(1\\leq i\\leq M)$\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $M$\n$B _ 1$ $B _ 2$ $\\ldots$ $B _ N$\n$C _ 1$ $C _ 2$ $\\ldots$ $C _ M$"},{"iden":"sample input 1","content":"5 4\n100 200 300 400 500\n120 370 470 80"},{"iden":"sample output 1","content":"1280 2350 2850 1140\n\nFor example, he may set the price of the $1$\\-st item to $320$; then the $2$\\-nd, $3$\\-rd, $4$\\-th, and $5$\\-th customers will buy one. The gross sale of the $1$\\-st item will be $1280$. Since he cannot make the gross sale of the $1$\\-st item greater than $1280$, the $1$\\-st value to be printed is $1280$."},{"iden":"sample input 2","content":"4 4\n0 2 10 2\n13 13 0 4"},{"iden":"sample output 2","content":"52 52 10 18\n\nTwo customers may have the same motivation. Also, two items may have the same value."},{"iden":"sample input 3","content":"12 15\n16 592 222 983 729 338 747 61 451 815 838 281\n406 319 305 519 317 590 507 946 365 5 673 478 340 176 2"},{"iden":"sample output 3","content":"6280 5466 5382 7410 5454 8120 7290 11680 5870 3670 8950 7000 5620 4608 3655"},{"iden":"sample input 4","content":"5 5\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000 1000000000"},{"iden":"sample output 4","content":"10000000000 10000000000 10000000000 10000000000 10000000000\n\nNote that the gross sales may not fit into a $32$\\-bit integer type."}],"translated_statement":[{"iden":"problem statement","content":"高桥经营一家AtCoder商店。有 $N$ 位顾客光顾该商店，商店中出售 $M$ 件商品。第 $i$ 位顾客（$1\\leq i\\leq N$）的购买动机为 $B _ i$。第 $j$ 件商品（$1\\leq j\\leq M$）的价值为 $C _ j$。\n高桥为每件商品设定价格。第 $i$ 位顾客会购买第 $j$ 件商品，当且仅当该商品的价格 $P _ j$ 满足：\n\n* $B _ i+C _ j\\geq P _ j$。\n\n对于每个 $j=1,2,\\ldots,M$，请找出当高桥将价格设定为使该商品销售额最大化时，第 $j$ 件商品的总销售额。第 $j$ 件商品的总销售额定义为价格 $P _ j$ 与购买该商品的顾客数量的乘积。"},{"iden":"constraints","content":"* $1\\leq N\\leq2\\times10^5$\n* $1\\leq M\\leq2\\times10^5$\n* $0\\leq B _ i\\leq10^9\\quad(1\\leq i\\leq N)$\n* $0\\leq C _ i\\leq10^9\\quad(1\\leq i\\leq M)$\n* 输入中的所有值均为整数。"},{"iden":"input","content":"输入从标准输入按以下格式给出：\n\n$N$ $M$\n$B _ 1$ $B _ 2$ $\\ldots$ $B _ N$\n$C _ 1$ $C _ 2$ $\\ldots$ $C _ M$"},{"iden":"sample input 1","content":"5 4\n100 200 300 400 500\n120 370 470 80"},{"iden":"sample output 1","content":"1280 2350 2850 1140\n\n例如，他可以将第 $1$ 件商品的价格设为 $320$；此时第 $2$、$3$、$4$ 和 $5$ 位顾客会各购买一件。第 $1$ 件商品的总销售额为 $1280$。由于他无法使第 $1$ 件商品的总销售额超过 $1280$，因此第一个输出值为 $1280$。"},{"iden":"sample input 2","content":"4 4\n0 2 10 2\n13 13 0 4"},{"iden":"sample output 2","content":"52 52 10 18\n\n两位顾客的动机可能相同。同时，两件商品的价值也可能相同。"},{"iden":"sample input 3","content":"12 15\n16 592 222 983 729 338 747 61 451 815 838 281\n406 319 305 519 317 590 507 946 365 5 673 478 340 176 2"},{"iden":"sample output 3","content":"6280 5466 5382 7410 5454 8120 7290 11680 5870 3670 8950 7000 5620 4608 3655"},{"iden":"sample input 4","content":"5 5\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000 1000000000"},{"iden":"sample output 4","content":"10000000000 10000000000 10000000000 10000000000 10000000000\n\n请注意，总销售额可能超出 $32$ 位整数类型的范围。"}],"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}