ABC201A - Tiny Arithmetic Sequence
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Score : 100 points
Problem Statement
You are given a sequence of three numbers: A=(A1,A2,A3).
Is it possible to rearrange the elements of A into an arithmetic sequence?
In other words, is it possible to rearrange the elements of A so that A3−A2=A2−A1?
Constrains
- 1≤Ai≤100
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
A1 A2 A3
Output
If it is possible to rearrange the elements of A into an arithmetic sequence, print Yes
; otherwise, print No
.
Sample Input 1
5 1 3
Sample Output 1
Yes
We can rearrange them into an arithmetic sequence by, for example, making it (1,3,5).
Sample Input 2
1 4 3
Sample Output 2
No
There is no way to rearrange them into an arithmetic sequence.
Sample Input 3
5 5 5
Sample Output 3
Yes
All elements of A may be equal, or A may be an arithmetic sequence already.
ABC201
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2023-6-28 8:00
- End at
- 2023-6-28 10:00
- Duration
- 2 hour(s)
- Host
- Partic.
- 10