Count the Regions
Time Limit: 2 Seconds
Memory Limit: 65536 KB
What's the maximum number of regions definable by N zig-zag lines, each of
which consists of two parallel infinite half-lines joined by a straight line
Here is an example of 2 zig-zag lines yield 12 regions at the most.
The input consists of a sequence of N (<= 10000), which is the number of
the zig-zag lines, one per line.
For each N, you should output the number of the maximum regions.
Author: SHEN, Guanghao
Source: ZOJ Monthly, October 2003