Submit solution
Points:
1.70
Time limit:
1.0s
Memory limit:
512M
Input:
stdin
Output:
stdout
Problem source:
Problem types
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch
In case the statement didn't load correctly, you can download the statement here: Statement
Sample Input 1
5 2
2 4 3 1 5
Sample Output 1
2
Sample Input 2
6 120
1 2 3 4 5 6
Sample Output 2
720
Sample Input 3
6 120
1 2 3 4 6 5
Sample Output 3
0
Sample Input 4
10 15
4 8 5 1 3 10 9 2 7 6
Sample Output 4
465
Comments