Long gone are the days of math homework. Now that the final year of school is beginning, students are expected to do their own independent study of their subjects instead. To help them study, the students will be grouped into study groups.
There are
At the end of each day, the students in each study group will meet and share the information they learnt about the subject they studied that day. To reinforce learnt material, on each day, and for each subject, the students who studied that subject on that day should belong to the same study group. Study groups must not change on any day.
As the principal, you wish for there to be as many study groups as possible. To maximise the number of study groups, you have enough influence to make one adjustment plan: you may choose two integers
Can you determine the optimal adjustment to the plan, and an optimal allocation of students to study groups?
If the adjustment to the plan is not optimal, but the allocation of students to study groups is optimal for the chosen plan, you will receive
Constraints
Input Specification
The first line contains a single integer,
The second line contains
Output Specification
On the first line, output two space-separated integers,
On the second line, output
Sample Input
4
2 3 4 3
Sample Output
2 1
1 2 3 4
Explanation
If no adjustment to the plan is made, it can be shown that at most two study groups can be formed, as demonstrated by the table below. Students
Day | Student | Student | Student | Student |
---|---|---|---|---|
When the adjustment to plan is made, all four students can be in their own separate study group.
Comments