{"problem":{"name":"Left Right Operation","description":{"content":"You are given an integer sequence of length $N$: $A=(A_1,A_2,\\ldots,A_N)$. You will perform the following consecutive operations just once: *   Choose an integer $x$ $(0\\leq x \\leq N)$. If $x$ is $0$","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc263_d"},"statements":[{"statement_type":"Markdown","content":"You are given an integer sequence of length $N$: $A=(A_1,A_2,\\ldots,A_N)$.\nYou will perform the following consecutive operations just once:\n\n*   Choose an integer $x$ $(0\\leq x \\leq N)$. If $x$ is $0$, do nothing. If $x$ is $1$ or greater, replace each of $A_1,A_2,\\ldots,A_x$ with $L$.\n    \n*   Choose an integer $y$ $(0\\leq y \\leq N)$. If $y$ is $0$, do nothing. If $y$ is $1$ or greater, replace each of $A_{N},A_{N-1},\\ldots,A_{N-y+1}$ with $R$.\n    \n\nPrint the minimum possible sum of the elements of $A$ after the operations.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2\\times 10^5$\n*   $-10^9 \\leq L, R\\leq 10^9$\n*   $-10^9 \\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$ $L$ $R$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc263_d","tags":[],"sample_group":[["5 4 3\n5 5 0 6 3","14\n\nIf you choose $x=2$ and $y=2$, you will get $A = (4,4,0,3,3)$, for the sum of $14$, which is the minimum sum achievable."],["4 10 10\n1 2 3 4","10\n\nIf you choose $x=0$ and $y=0$, you will get $A = (1,2,3,4)$, for the sum of $10$, which is the minimum sum achievable."],["10 -5 -3\n9 -6 10 -1 2 10 -1 7 -15 5","\\-58\n\n$L$, $R$, and $A_i$ may be negative."]],"created_at":"2026-03-03 11:01:14"}}