β Max permute (Contest)
Max permute (Contest) easy Time Limit: 2 sec Memory Limit: 128000 k
```java
import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework
// don't change the name of this class
// you can add inner classes if needed
class Main {
public static void main (String[] args) {
Scanner inp = new Scanner(System.in);
long n = inp.nextLong();
long sum = 0;
sum = ((n-1)*n)/2;
System.out.print(sum);
}
}
```Last updated