#P1154. 奶牛分厩
奶牛分厩
Description
Farmer John has cows. Each cow has a unique ID , different from every other cow. All the cows sleep in a barn that has stalls, labeled to . No two cows may share the same stall. Each cow knows which stall to sleep in because John taught them division: the stall index for the -th cow is .
Find the smallest such that the assignment is valid (i.e., all cows are assigned to distinct stalls).
Input Format
The first line contains a positive integer . Lines through each contain one integer, the ID of a cow.
Output Format
Output a single integer, the minimal . For all testdata, such a is guaranteed to exist.
5
4
6
9
10
13
8
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号