{"raw_statement":[{"iden":"statement","content":"For this task, you will be required to find a set of simple statistics based on a given set of data. Data will be provided as an array of integers, and you will be tasked with finding the mean, median, mode, and range of the data.\n\nThe first line will contain $n$, the number of values in the array. The second line will contain space-separated integers that correspond to the array of input values.\n\nThe output should print the mean, median, mode, and range of the provided data in order and separated by lines(ie. the first line has the mean, the second line has the median, etc).\n\n"},{"iden":"input","content":"The first line will contain $n$, the number of values in the array. The second line will contain space-separated integers that correspond to the array of input values."},{"iden":"output","content":"The output should print the mean, median, mode, and range of the provided data in order and separated by lines(ie. the first line has the mean, the second line has the median, etc)."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ denote the number of data points.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of integers.\n\n**Constraints**  \n$ n \\geq 1 $, and $ a_i \\in \\mathbb{Z} $ for all $ i \\in \\{1, \\dots, n\\} $.\n\n**Objective**  \nCompute the following statistics for $ A $:  \n1. **Mean**: $ \\mu = \\frac{1}{n} \\sum_{i=1}^{n} a_i $  \n2. **Median**:  \n   - If $ n $ is odd: $ \\text{median} = a_{(n+1)/2} $ (after sorting)  \n   - If $ n $ is even: $ \\text{median} = \\frac{a_{n/2} + a_{n/2 + 1}}{2} $ (after sorting)  \n3. **Mode**: The value(s) with maximum frequency; if multiple, return the smallest such value.  \n4. **Range**: $ \\text{range} = \\max(A) - \\min(A) $","simple_statement":"Given an array of integers, find and print the mean, median, mode, and range, each on a separate line.","has_page_source":false}