{"problem":{"name":"J. Weird Sanchola","description":{"content":"Sanchola is getting an array of integers as gift. He's weird, so he doesn't like having distinct integers in the same array and he only likes prime numbers. That's why he believes that he might need t","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10230J"},"statements":[{"statement_type":"Markdown","content":"Sanchola is getting an array of integers as gift. He's weird, so he doesn't like having distinct integers in the same array and he only likes prime numbers. That's why he believes that he might need to fix the array after receiving it by turning all elements into the same prime number.\n\nSanchola is also very lazy and wants to do that using the minimum number of operations. In one operation Sanchola can either increase or decrease a single element of the array by one.\n\nGiven the array that he received as a gift, help Sanchola figuring out the minimum number of operations required to fix the array.\n\nThe first line contains a single integer $N$ $(1 <= N <= 10^5)$, indicating the length of the array.\n\nThe second line contains $N$ integers $a_1$, $a_2$, ..., $a_n$ $(1 <= N <= 10^9)$, indicating the elements of the array $a$.\n\nIn a single line output the minimum number of operations to satisfy Sanchola.\n\n## Input\n\nThe first line contains a single integer $N$ $(1 <= N <= 10^5)$, indicating the length of the array.The second line contains $N$ integers $a_1$, $a_2$, ..., $a_n$ $(1 <= N <= 10^9)$, indicating the elements of the array $a$.\n\n## Output\n\nIn a single line output the minimum number of operations to satisfy Sanchola.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $, $ \\mathbf{A} \\in \\mathbb{R}^{n \\times n} $, $ \\mathbf{b} = (b_1, \\dots, b_n) \\in \\mathbb{Z}_{>0}^n $.  \nDefine the linear map $ \\mathbf{y}(\\mathbf{x}) = \\mathbf{A} \\mathbf{x} $ for $ \\mathbf{x} \\in \\mathbb{R}^n $.  \n\n**Constraints**  \nThe integral is over the region:  \n$$\nR = \\left\\{ \\mathbf{x} \\in \\mathbb{R}^n \\,\\middle|\\, 0 \\leq (\\mathbf{A} \\mathbf{x})_k \\leq b_k \\text{ for all } k = 1, \\dots, n \\right\\}\n$$  \nThe objective is to compute:  \n$$\nI = \\left( \\int_{\\mathbb{R}^n} \\prod_{k=1}^n \\mathbf{1}_{[0, b_k]}((\\mathbf{A} \\mathbf{x})_k) \\, d\\mathbf{x} \\right)^2\n$$  \nAssume $ I $ is finite and rational: $ I = \\frac{u}{d} $, $ \\gcd(u,d) = 1 $.  \n\n**Objective**  \nIf $ I $ is infinite or $ d^{-1} \\not\\equiv \\pmod{1000000007} $, output `\"Orz\"`.  \nOtherwise, output $ u \\cdot d^{-1} \\mod 1000000007 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10230J","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}