P2915 [USACO08NOV] Mixed Up Cows G
Description
Each of Farmer John's N (4
Input Format
\* Line 1: Two space-separated integers: N and K
\* Lines 2..N+1: Line i+1 contains a single integer that is the serial number of cow i: S\_i
Output Format
\* Line 1: A single integer that is the number of ways that N cows can be 'Mixed Up'. The answer is guaranteed to fit in a 64 bit integer.
Explanation/Hint
The 2 possible Mixed Up arrangements are:
3 1 4 2
2 4 1 3