Problem G
Vase Collection
Mr Cheng is a collector of old Chinese porcelain, more specifically late 15th century Feng dynasty vases. The art of vase-making at this time followed very strict artistic rules. There was a limited number of accepted styles, each defined by its shape and decoration. More specifically, there were 36 vase shapes and 36 different patterns of decoration – in all 1296 different styles.
For a collector, the obvious goal is to own a sample of each
of the 1296 styles. Mr Cheng however, like so many other
collectors, could never afford a complete collection, and
instead concentrates on some shapes and some decorations. As
symmetry between shape and decoration was one of the main
aestheathical paradigms of the Feng dynasty, Mr Cheng wants to
have a full collection of all combinations of
Input
On the first line of the input, there is a single positive
integer
Output
For each test scenario, output one line containing the
maximum
Sample Input 1 | Sample Output 1 |
---|---|
2 5 11 13 23 5 17 36 11 5 23 13 2 23 15 15 23 |
2 1 |