atcoder#ARC123A. [ARC123A] Arithmetic Sequence
[ARC123A] Arithmetic Sequence
Score : points
Problem Statement
Given is a sequence of three integers . On this sequence, you can do the following operation any number of times:
- choose and add to .
Find the minimum number of operations needed to make arithmetic. Here, the sequence is arithmetic when holds.
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
4 8 10
2
One operation with and then one operation with yield an arithmetic sequence .
10 3 4
4
Four operations with yield an arithmetic sequence .
1 2 3
0
The sequence is already arithmetic from the beginning, so we need zero operations.
1000000000000000 1 1000000000000000
999999999999999