Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/begin-tezlanuvchan-harakat

Uniformly accelerated motion

Easy 1000 ms 64 MB 12%
Share

A body moves in a straight line with constant acceleration: initial speed $v_{0}$ m/s, acceleration $a$ m/s². Find its speed $v$ after $t$ seconds and the distance $s$ covered in that time:

$$v = v_{0} + a * t, \qquad s = v_{0} * t + \frac{a * t^{2}}{2}$$

Speed versus time graph: the speed grows evenly from v0 to v; the area under the graph is the distance s

Input

One line with three integers: $v_{0}$, $a$ and $t$.

Output

One line with two numbers: $v$ — an integer, $s$ — with exactly 1 digit after the decimal point (for example, 32.0).

Note

$0 \le v_{0} \le 1000$
$0 \le a \le 100$
$0 \le t \le 1000$

Examples

Input #1
2 3 4
Output #1
14 32.0
Input #2
0 1 3
Output #2
3 4.5

Sign in to submit a solution

Signing up is free and takes a minute.