{"problem":{"name":"R. 6227020800","description":{"content":"You are given an encrypted string, encrypted using a certain algorithm.Decrypt it ! The first and single line of input contains a string s, which each of it's characters is a lower case English lette","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CFR"},"statements":[{"statement_type":"Markdown","content":"You are given an encrypted string, encrypted using a certain algorithm.Decrypt it !\n\nThe first and single line of input contains a string s, which each of it's characters is a lower case English letter. (1 ≤ |s| ≤ 105)\n\nPrint the original string.\n\n## Input\n\nThe first and single line of input contains a string s, which each of it's characters is a lower case English letter. (1 ≤ |s| ≤ 105)\n\n## Output\n\nPrint the original string.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"*简易版与困难版的唯一区别在于 $n$ 的约束。*\n\n刚在数据结构课上学到双端队列的 Gunga，现在正玩着他自己的双端队列。他有一个空的双端队列 $B$ 和一个整数数组 $A$。在第 $i$ 次操作中，他会将 $A_i$ 添加到 $B$ 的某一端。这一次，他希望求出所有 $2^n$ 种可能形成的 $B$ 中，$B_L$ 到 $B_R$ 的和的总和。由于答案可能很大，请输出答案对 $10^9 + 7$ 取模的结果。两个队列被认为是不同的，如果 Gunga 对某个 $A_i$ 的操作方式不同。\n\n第一行包含三个整数 $n, L, R$ $(1 lt.eq n lt.eq 5 times 10^5, 1 lt.eq L lt.eq R lt.eq n)$ —— 整数个数和 Gunga 的目标区间。\n\n第二行包含 $n$ 个用空格分隔的整数 $A_1, A_2, dots.h, A_n$ $(-10^9 lt.eq A_i lt.eq 10^9)$。\n\n输出一个整数，表示答案对 $10^9 + 7$ 取模的结果。\n\n在第一个例子中，无论 Gunga 将数字添加到队列的哪一端，最终队列都是 $[ 1, 1, 1, 1, 1 ]$。总和为 $32 times (1 + 1 + 1 + 1 + 1) = 160$。\n\n在第二个例子中，有 $8$ 种可能的队列 $B$：$[ 1, 2, 3 ], [ 1, 2, 3 ], [ 2, 1, 3 ], [ 2, 1, 3 ], [ 3, 2, 1 ], [ 3, 2, 1 ], [ 3, 1, 2 ], [ 3, 1, 2 ]$。\n\n$B_1$ 到 $B_2$ 的和的总和为 $2 times (1 + 2 + 2 + 1 + 3 + 2 + 3 + 1) = 30$。\n\n## Input\n\n第一行包含三个整数 $n, L, R$ $(1 lt.eq n lt.eq 5 times 10^5, 1 lt.eq L lt.eq R lt.eq n)$ —— 整数个数和 Gunga 的目标区间。第二行包含 $n$ 个用空格分隔的整数 $A_1, A_2, dots.h, A_n$ $(-10^9 lt.eq A_i lt.eq 10^9)$。\n\n## Output\n\n输出一个整数，表示答案对 $10^9 + 7$ 取模的结果。\n\n[samples]\n\n## Note\n\n在第一个例子中，无论 Gunga 将数字添加到队列的哪一端，最终队列都是 $[ 1, 1, 1, 1, 1 ]$。总和为 $32 times (1 + 1 + 1 + 1 + 1) = 160$。在第二个例子中，有 $8$ 种可能的队列 $B$：$[ 1, 2, 3 ], [ 1, 2, 3 ], [ 2, 1, 3 ], [ 2, 1, 3 ], [ 3, 2, 1 ], [ 3, 2, 1 ], [ 3, 1, 2 ], [ 3, 1, 2 ]$。$B_1$ 到 $B_2$ 的和的总和为 $2 times (1 + 2 + 2 + 1 + 3 + 2 + 3 + 1) = 30$。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n, L, R \\in \\mathbb{Z} $ with $ 1 \\leq L \\leq R \\leq n $.  \nLet $ A = (A_1, A_2, \\dots, A_n) $ be a sequence of integers.  \nLet $ \\mathcal{B} $ be the set of all $ 2^n $ possible double-ended queues (deques) formed by sequentially inserting each $ A_i $ at either the front or back of an initially empty deque $ B $.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 5 \\times 10^5 $  \n2. $ 1 \\leq L \\leq R \\leq n $  \n3. $ -10^9 \\leq A_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nCompute:  \n$$\n\\sum_{B \\in \\mathcal{B}} \\sum_{j=L}^{R} B_j \\mod (10^9 + 7)\n$$  \nwhere $ B_j $ denotes the element at position $ j $ (1-indexed) in deque $ B $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CFR","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}