SHARE
TWEET

FromOneToN




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- var
- a: int64;
- begin
- readln(a);
- if(a > 0) then
- if a mod 2 = 0 then
- writeln((a + 1) * (a / 2))
- else
- writeln((a + 1) / 2 * a)
- else
- if a mod 2 = 0 then
- writeln((a + 1) * ((2 - a) / 2))
- else
- writeln((a + 1) / 2 * (2 - a));
- end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.