303409: CF661A. Lazy Caterer Sequence
Memory Limit:64 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
A. Lazy Caterer Sequencetime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output
Lazy caterer sequence is defined as the maximum number of pieces formed when slicing a convex pancake with n cuts (each cut is a straight line). The formula is Cn = n·(n + 1) / 2 + 1. You are given n; calculate n-th element of the sequence.
InputThe only line of the input contains an integer n (0 ≤ n ≤ 100).
OutputOutput the n-th element of lazy caterer sequence.
ExamplesInput2Output
4Input
5Output
16