{"raw_statement":[{"iden":"statement","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"},{"iden":"input","content":"The 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$."},{"iden":"output","content":"In a single line output the minimum number of operations to satisfy Sanchola."},{"iden":"examples","content":"Input3\n2 3 10\nOutput8\nInput2\n1 1000000000\nOutput999999999\nInput4\n3 5 7 11\nOutput10\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**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 $.","simple_statement":"The problem asks: Given an n×n matrix A and n positive integers b₁, b₂, ..., bₙ, compute the square of the volume of the region where 0 ≤ (Ax)ₖ ≤ bₖ for all k, with x ∈ ℝⁿ. Output the result modulo 1000000007, or \"Orz\" if the answer is infinite or not a valid rational.","has_page_source":false}