{"raw_statement":[{"iden":"statement","content":"There are _n_ boxes with colored balls on the table. Colors are numbered from 1 to _n_. _i_\\-th box contains _a__i_ balls, all of which have color _i_. You have to write a program that will divide all balls into sets such that:\n\n*   each ball belongs to exactly one of the sets,\n*   there are no empty sets,\n*   there is no set containing two (or more) balls of different colors (each set contains only balls of one color),\n*   there are no two sets such that the difference between their sizes is greater than 1.\n\nPrint the minimum possible number of sets."},{"iden":"input","content":"The first line contains one integer number _n_ (1 ≤ _n_ ≤ 500).\n\nThe second line contains _n_ integer numbers _a_1, _a_2, ... , _a__n_ (1 ≤ _a__i_ ≤ 109)."},{"iden":"output","content":"Print one integer number — the minimum possible number of sets."},{"iden":"examples","content":"Input\n\n3\n4 7 8\n\nOutput\n\n5\n\nInput\n\n2\n2 7\n\nOutput\n\n4"},{"iden":"note","content":"In the first example the balls can be divided into sets like that: one set with 4 balls of the first color, two sets with 3 and 4 balls, respectively, of the second color, and two sets with 4 balls of the third color."}],"translated_statement":[{"iden":"statement","content":"桌上有 #cf_span[n] 个装有彩球的盒子。颜色编号从 #cf_span[1] 到 #cf_span[n]。第 #cf_span[i] 个盒子包含 #cf_span[ai] 个球，所有球的颜色均为 #cf_span[i]。你需要编写一个程序，将所有球划分为若干集合，使得：\n\n请输出可能的最少集合数量。\n\n第一行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 500]）。\n\n第二行包含 #cf_span[n] 个整数 #cf_span[a1, a2, ... , an]（#cf_span[1 ≤ ai ≤ 109]）。\n\n请输出一个整数 —— 可能的最少集合数量。\n\n在第一个例子中，球可以被划分为如下集合：一个包含 #cf_span[4] 个第一种颜色球的集合，两个分别包含 #cf_span[3] 和 #cf_span[4] 个第二种颜色球的集合，以及两个各包含 #cf_span[4] 个第三种颜色球的集合。\n\n"},{"iden":"input","content":"第一行包含一个整数 #cf_span[n]（#cf_span[1 ≤ n ≤ 500]）。第二行包含 #cf_span[n] 个整数 #cf_span[a1, a2, ... , an]（#cf_span[1 ≤ ai ≤ 109]）。"},{"iden":"output","content":"请输出一个整数 —— 可能的最少集合数量。"},{"iden":"examples","content":"输入34 7 8输出5输入22 7输出4"},{"iden":"note","content":"在第一个例子中，球可以被划分为如下集合：一个包含 #cf_span[4] 个第一种颜色球的集合，两个分别包含 #cf_span[3] 和 #cf_span[4] 个第二种颜色球的集合，以及两个各包含 #cf_span[4] 个第三种颜色球的集合。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of colors.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of positive integers, where $ a_i $ is the number of balls of color $ i $.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 500 $  \n2. $ 1 \\leq a_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nFind the minimum number of sets $ k \\in \\mathbb{Z}^+ $ such that the balls can be partitioned into $ k $ sets, where in each set, no two balls have the same color (i.e., each set contains at most one ball of each color).","simple_statement":null,"has_page_source":false}