시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB36711747159550.031%

문제

상근이는 등차수열을 이루는 정수 4개를 골랐다. 이것은 상근이가 고른 수 4개를 정렬했을 때, 인접한 쌍의 차이가 일정하다는 것을 의미한다. 그 다음 이렇게 고른 수 4개를 노래로 만들어서 외우고 다닌다.

어느 날, 상근이는 자신이 고른 4개 수 중 1개를 까먹었다. 상근이가 기억하고 있는 수 세 개가 주어졌을 때, 까먹은 수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 상근이가 고른 4개의 수 중 3개가 주어진다. 이 수는 크기 순이 아닐 수도 있고, -100보다 크거나 같고, 100보다 작거나 같은 정수이다.

출력

첫째 줄에 까먹은 수를 출력한다. 정답이 여러 개일 경우에는 아무거나 출력하면 된다. 또한 정답이 존재하지 않는 경우는 입력으로 주어지지 않는다.

예제 입력 1

4 6 8

예제 출력 1

10

예제 입력 2

10 1 4

예제 출력 2

7
W3sicHJvYmxlbV9pZCI6IjI5OTciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIxMjQgXHViYzg4XHVjOWY4IFx1YzIxOCIsImRlc2NyaXB0aW9uIjoiPHA+XHVjMGMxXHVhZGZjXHVjNzc0XHViMjk0IFx1YjRmMVx1Y2MyOFx1YzIxOFx1YzVmNFx1Yzc0NCBcdWM3NzRcdWI4ZThcdWIyOTQgXHVjODE1XHVjMjE4IDRcdWFjMWNcdWI5N2MgXHVhY2U4XHViNzkwXHViMmU0LiBcdWM3NzRcdWFjODNcdWM3NDAgXHVjMGMxXHVhZGZjXHVjNzc0XHVhYzAwIFx1YWNlMFx1Yjk3OCBcdWMyMTggNFx1YWMxY1x1Yjk3YyBcdWM4MTVcdWI4MmNcdWQ1ODhcdWM3NDQgXHViNTRjLCBcdWM3NzhcdWM4MTFcdWQ1NWMgXHVjMzBkXHVjNzU4IFx1Y2MyOFx1Yzc3NFx1YWMwMCBcdWM3N2NcdWM4MTVcdWQ1NThcdWIyZTRcdWIyOT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