Problem list
Log in
#r02955 · Online Judge > GoldOJ

Write the Expression

Bronze II 2.0 s 1024 MB

Given $a \le b$, add every even integer in $[a, b]$ and subtract every odd one. Print the full expression and its result, e.g. -1+2-3+4-5=-3. Each term is prefixed with + if even and - if odd (including the first term).

Input

Two integers $a$ and $b$ ($1 \le a \le b \le 1000$).

Output

Print the signed expression followed by = and the result.

Example 1

Input
1 5
Output
-1+2-3+4-5=-3

Example 2

Input
2 4
Output
+2-3+4=3
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code