#884
ČETIRI
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%
문제
Mirko has chosen four integers which form an arithmetic progression. In other words, when the four numbers are sorted, then the difference between each pair of adjacent elements is constant. As has become usual, Mirko lost one of the numbers and also is not sure whether the remaining three are in the correct (sorted) order. Write a program that, given the three remaining numbers, finds the fourth number.
입력
The input contains 3 integers between −100 and 100 on a single line, separated by single spaces. Note: the input data will guarantee that a solution, although not necessarily unique, will always exist.
출력
Output any number which could have been the fourth number in the sequence.
예제 입력 1
4 6 8
예제 출력 1
10
예제 입력 2
10 1 4
예제 출력 2
7
코드 제출
코드를 제출하려면 로그인이 필요합니다.
로그인내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.