diff options
Diffstat (limited to '')
-rw-r--r-- | šola/p1/dn/DN01_63230317.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/šola/p1/dn/DN01_63230317.java b/šola/p1/dn/DN01_63230317.java new file mode 100644 index 0000000..d7f0659 --- /dev/null +++ b/šola/p1/dn/DN01_63230317.java @@ -0,0 +1,14 @@ +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); + } +} |