{"raw_statement":[{"iden":"problem statement","content":"You are given positive integers $a$ and $b$ such that $a\\leq b$, and a sequence of positive integers $A = (A_1, A_2, \\ldots, A_N)$.\nOn this sequence, you can perform the following operation any number of times (possibly zero):\n\n*   Choose distinct indices $i, j$ ($1\\leq i, j \\leq N$). Add $a$ to $A_i$ and subtract $b$ from $A_j$.\n\nFind the maximum possible value of $\\min(A_1, A_2, \\ldots, A_N)$ after your operations."},{"iden":"constraints","content":"*   $2\\leq N\\leq 3\\times 10^5$\n*   $1\\leq a\\leq b\\leq 10^9$\n*   $1\\leq A_i\\leq 10^{9}$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $a$ $b$\n$A_1$ $A_2$ $\\ldots$ $A_N$"},{"iden":"sample input 1","content":"3 2 2\n1 5 9"},{"iden":"sample output 1","content":"5\n\nHere is one way to achieve $\\min(A_1, A_2, A_3) = 5$.\n\n*   Perform the operation with $i = 1, j = 3$. $A$ becomes $(3, 5, 7)$.\n*   Perform the operation with $i = 1, j = 3$. $A$ becomes $(5, 5, 5)$."},{"iden":"sample input 2","content":"3 2 3\n11 1 2"},{"iden":"sample output 2","content":"3\n\nHere is one way to achieve $\\min(A_1, A_2, A_3) = 3$.\n\n*   Perform the operation with $i = 1, j = 3$. $A$ becomes $(13, 1, -1)$.\n*   Perform the operation with $i = 2, j = 1$. $A$ becomes $(10, 3, -1)$.\n*   Perform the operation with $i = 3, j = 1$. $A$ becomes $(7, 3, 1)$.\n*   Perform the operation with $i = 3, j = 1$. $A$ becomes $(4, 3, 3)$."},{"iden":"sample input 3","content":"3 1 100\n8 5 6"},{"iden":"sample output 3","content":"5\n\nYou can achieve $\\min(A_1, A_2, A_3) = 5$ by not performing the operation at all."},{"iden":"sample input 4","content":"6 123 321\n10 100 1000 10000 100000 1000000"},{"iden":"sample output 4","content":"90688"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}