Game of Chairs

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

You are participating in a strange game. There are nn chairs in a row at a distance of one meter from each other. Each chair is painted by one of cc different colors.

At the beginning, you can sit on any chair. Then the jury will choose a color and announce it. Each color has 1c\frac{1}{c} probability to be chosen. Your task is to move to any chair of this color.

Of course, you will move to the nearest appropriate chair. If you are already sitting on it, you will not move at all.

You want to pick a chair to sit at the beginning to minimize the expected distance which you will have to walk.

입력

In the first line there are two integers nn and cc: the number of chairs and the number of colors (1cn1061 \leq c \leq n \leq 10^6).

The second line contains nn integers a_ia\_i: the colors of chairs (1a_ic1 \leq a\_i \leq c). There is at least one chair of each color.

출력

Output the expected distance as an irreducible fraction.