Kiểm tra trung bình

PDF

Submit solution

Points: 10.00 (partial)
Time limit: 1.0s
Memory limit: 64M
Input: stdin
Output: stdout

Problem types
Allowed languages
C, C++, Java, Pascal, Python, Scratch, TEXT

Cho 3 số nguyên ~a, b, c~. Kiểm tra xem có tồn tại một số nguyên là trung bình của 2 số còn lại hay không? Nếu tồn tại xuất ra số nguyên đó, ngược lại xuất -1.

Dữ liệu:

Dòng duy nhất chứa 3 số nguyên ~a, b, c~.

Kết quả:

Dòng duy nhất là kết quả.

Input

1 2 3

Output

2

Input 2

1 2 1

Output 2

-1

Comments

Please read the guidelines before commenting.


There are no comments at the moment.