blob: d7f06592ea0fb828fc1bdba00af991816f2f8dfc (
plain) (
tree)
|
|
import java.util.*;
public class DN01_63230317 {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
if (b < a) {
a += b;
b = a-b;
a -= b;
}
System.out.println((a-1)*(a*b)-(a-1)*a/2*(a+b)+(a-1)*a*(2*(a-1)+1)/6);
}
}
|