## Riolku's Mock CCC S2 - Keen Keener Sequence

View as PDF

Points: 7 (partial)
Time limit: 2.0s
Memory limit: 512M

Authors:
Problem types

Keen Keen Guglor the Keener is keen to know more about a sequence of numbers he received yesterday, labeled . More specifically, he wants to compute the number of ordered -tuples such that are pairwise distinct and . Unfortunately, even though he is so keen to know the answer to his question, he was unable to figure it out himself and hopes that you could help him with the problem.

#### Input Specification

The first line will contain the integer .

The second line will contain the space-separated integers .

#### Output Specification

On one line, output the number of -tuples as specified in the problem statement.

#### Sample Input 1

4
1 2 4 8

#### Sample Output 1

8

#### Explanation for Sample Output 1

Our tuples are, (with the elements representing the indices), and .

#### Sample Input 2

4
5 5 5 5

#### Sample Output 2

24

#### Sample Input 3

10
1 4 8 6 2 9 4 2 5 3

#### Sample Output 3

160