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

~/algor $ cat problems/ishorasi-almashinuvchi-qator

Alternating series

Easy 1000 ms 64 MB 26%
Share

A positive integer $N$ is given. Compute the alternating sum of $N$ terms:

$$S = 1.1 - 1.2 + 1.3 - 1.4 + \dots$$

The absolute value of the $k$-th term is $1 + 0.1 * k$; terms in odd positions are added, terms in even positions are subtracted.

An alternating sum of decimal fractions

Input

One positive integer $N$.

Output

One number — $S$, with exactly 2 digits after the decimal point (for example, 1.10).

Note

$1 \le N \le 50$

Examples

Input #1
1
Output #1
1.10
Input #2
2
Output #2
-0.10

Sign in to submit a solution

Signing up is free and takes a minute.