1274 - I2P (I) 2017_Yang_Lab1 Scoreboard

Time

2017/09/21 13:50:00 2017/09/21 15:10:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
10716 Arithmetic Sequence
11551 chickens and rabbits

10716 - Arithmetic Sequence   

Description

An arithmetic sequence is a sequence of numbers such that the difference between the consecutive terms is a constant. For instance, the sequence 5, 7, 9, 11, 13, 15 … is an arithmetic sequence with common difference of 2.

Here, you are given an arithmetic sequence, where the initial term is ‘a’, the total number of terms in this sequence is ‘n’, and the common difference of successive terms is ‘d’. Then, in this sequence: what is the value of the nth term, and what is the sum of all the terms?

Input

Three integers separated by blanks. The first integer (a) is the initial term, where -1000<a<1000. The second integer (n) is the total number of terms in the sequence, where n>0 and n<1000. The third integer (d) is the common difference, where -1000<d<1000.

Output

Two values separated by a blank. The first value is the nth term of the sequence, and the second value is the sum of the sequence.  Note that you do not need to print '\n' at the end of the output.

Sample Input  Download

Sample Output  Download

Tags

121515 121515 10401HW1



Discuss




11551 - chickens and rabbits   

Description

The total number of chickens and rabbits is N, and overall they have M feet. How many chickens and how many rabbits are there?

Hint:

You might need to use the arithmetic operators + - * / for addition, subtraction, multiplication, and division.

Input

Two integers M and N, where 0<=N,M<=1000.

Output

Number of chickens and number of rabbits. Note that there is a newline character at the end of the output.

Sample Input  Download

Sample Output  Download

Tags




Discuss