Clique Coloring
Time limit2sMemory limit512 MB
Given up to five clique sizes, find the smallest number of vertices in a complete graph whose edges can be covered by cliques of those sizes with no repeated edge.
- Level
Hard8 of 10
- Topics
- Combinatorics, Math, Brute force, Implementation
- Solved
- No attempts yet
Problem
There is a complete graph with vertices. Initially, no edge of the graph is colored. For each (), Snuke performed the following operation: choose vertices of the graph and paint every edge connecting two of the chosen vertices with color . It turned out that no edge was painted more than once. Compute the minimum possible value of .
Input
The first line of input contains one integer (). Then lines follow; the -th of these lines contains one integer ().
Output
Print the minimum possible value of .
Hint
Number the vertices of the graph . For example, you can color the graph as follows.
- Choose vertices and color the edges between them with color .
- Choose vertices and color the edges between them with color .