Triangle Side Sum


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Java, JS, Kotlin, Lisp, Lua, ObjC, OCaml, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

You are given two integer segment lengths A and B, find the sum of all possible integer C such that we can construct a triangle with A, B and C.

Especificación de entrada

The input contains two integers A and B (1 <= A, B <= 10^9).

Especificación de salida

Print the requested sum.

Ejemplo de entrada

2 2

Ejemplo de salida

6

Sugerencia(s)

Use long long data type.


Comments

There are no comments at the moment.