Baluteshih is doing a fake uniformly accelerated motion on a number line.
He starts at $x_0$.
The initial velocity is $v_0$.
The acceleration is $a$.
And he do this motion last for $t$ seconds.
This motion is different from normal uniformly accelerated motion.
At every second, he move $v$ units.
And then his $v$ will increase $a$.
Calculate the final position after he finish this motion.
For example:
Baluteshih starts at $5$ (which is $x_0$).
And his initial velocity is $3$ (which is $v_0$).
The acceleration is $2$ (which is $a$).
And $t=4$.
At beginning, let $v=v_0=3$
After $1$ second, he will stand on $8$, then $v$ increases $2$.($v\Rightarrow5$)
After $2$ seconds, he will stand on $13$, $v$ increases $2$.($v\Rightarrow7$)
After $3$ seconds, he will stand on $20$, $v$ increases $2$.($v\Rightarrow9$)
After $4$ seconds, he will stand on $29$.
After he finished this motion, he stand on $29$, so the answer is $29$.
One line contains four integers $x_0,v_0,a,t$.
One line contains an integer which represents the final position.
No. | Testdata Range | Constraints | Score |
---|---|---|---|
1 | 0~8 | $x_0=a=0,t\leq10^ 4$ | 10 |
2 | 0~17 | $a=0,t\leq10^ 4$ | 6 |
3 | 0~26 | $|a|\leq5, t\leq10^ 4$ | 14 |
4 | 0~35 | No specified restriction | 5 |
No. | Time Limit (ms) | Memory Limit (KiB) | Output Limit (KiB) | Subtasks |
---|---|---|---|---|
0 | 1000 | 65536 | 65536 | |
1 | 1000 | 65536 | 65536 | |
2 | 1000 | 65536 | 65536 | |
3 | 1000 | 65536 | 65536 | |
4 | 1000 | 65536 | 65536 | |
5 | 1000 | 65536 | 65536 | |
6 | 1000 | 65536 | 65536 | |
7 | 1000 | 65536 | 65536 | |
8 | 1000 | 65536 | 65536 | |
9 | 1000 | 65536 | 65536 | |
10 | 1000 | 65536 | 65536 | |
11 | 1000 | 65536 | 65536 | |
12 | 1000 | 65536 | 65536 | |
13 | 1000 | 65536 | 65536 | |
14 | 1000 | 65536 | 65536 | |
15 | 1000 | 65536 | 65536 | |
16 | 1000 | 65536 | 65536 | |
17 | 1000 | 65536 | 65536 | |
18 | 1000 | 65536 | 65536 | |
19 | 1000 | 65536 | 65536 | |
20 | 1000 | 65536 | 65536 | |
21 | 1000 | 65536 | 65536 | |
22 | 1000 | 65536 | 65536 | |
23 | 1000 | 65536 | 65536 | |
24 | 1000 | 65536 | 65536 | |
25 | 1000 | 65536 | 65536 | |
26 | 1000 | 65536 | 65536 | |
27 | 1000 | 65536 | 65536 | |
28 | 1000 | 65536 | 65536 | |
29 | 1000 | 65536 | 65536 | |
30 | 1000 | 65536 | 65536 | |
31 | 1000 | 65536 | 65536 | |
32 | 1000 | 65536 | 65536 | |
33 | 1000 | 65536 | 65536 | |
34 | 1000 | 65536 | 65536 | |
35 | 1000 | 65536 | 65536 |