Count by X

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Given the first three numbers of an ascending arithmetic sequence, print the next three numbers of this sequence.

An arithmetic sequence is a list of numbers that have constant differences between any two adjacent numbers.

Input Specification

Three lines, each with an integer between -500 and 500, inclusive, in ascending order.

Output Specification

Three lines, each one containing the next number of the sequence.

Sample Input 1

1
3
5

Sample Output 1

7
9
11

Sample Input 2

100
175
250

Sample Output 2

325
400
475

Sample Explanations

In Sample 1, we can see the sequence is increasing by 2, so by continuously adding by 2, we get the next 3 numbers, 7, 9, and 11, respectively. For the second Sample, we can find that the difference is 75, so by adding 75 3 times we can get the next 3 values.


Comments

There are no comments at the moment.