{"problem":{"name":"Coupon","description":{"content":"There are $N$ items in a shop. For each $i = 1, 2, \\ldots, N$, the price of the $i$\\-th item is $A_i$ yen (the currency of Japan). Takahashi has $K$ coupons.   Each coupon can be used on one item. You","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc246_c"},"statements":[{"statement_type":"Markdown","content":"There are $N$ items in a shop. For each $i = 1, 2, \\ldots, N$, the price of the $i$\\-th item is $A_i$ yen (the currency of Japan).\nTakahashi has $K$ coupons.  \nEach coupon can be used on one item. You can use any number of coupons, possibly zero, on the same item. Using $k$ coupons on an item with a price of $a$ yen allows you to buy it for $\\max\\lbrace a - kX, 0\\rbrace$ yen.\nPrint the minimum amount of money Takahashi needs to buy all the items.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq K, X \\leq 10^9$\n*   $1 \\leq A_i \\leq 10^9$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$ $X$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc246_c","tags":[],"sample_group":[["5 4 7\n8 3 10 5 13","12\n\nBy using $1$ coupon on the $1$\\-st item, $1$ coupon on the $3$\\-rd item, and $2$ coupons on the $5$\\-th item, Takahashi can:\n\n*   buy the $1$\\-st item for $\\max\\lbrace A_1-X, 0 \\rbrace = 1$ yen,\n*   buy the $2$\\-nd item for $\\max\\lbrace A_2, 0 \\rbrace = 3$ yen,\n*   buy the $3$\\-rd item for $\\max\\lbrace A_3-X, 0 \\rbrace = 3$ yen,\n*   buy the $4$\\-th item for $\\max\\lbrace A_4, 0 \\rbrace = 5$ yen,\n*   buy the $5$\\-th item for $\\max\\lbrace A_5-2X, 0 \\rbrace = 0$ yen,\n\nfor a total of $1 + 3 + 3 + 5 + 0 = 12$ yen, which is the minimum possible."],["5 100 7\n8 3 10 5 13","0"],["20 815 60\n2066 3193 2325 4030 3725 1669 1969 763 1653 159 5311 5341 4671 2374 4513 285 810 742 2981 202","112"]],"created_at":"2026-03-03 11:01:13"}}