"Yes. Yes. This is a fertile land, and we will thrive. We will rule over all this land, and we will call it... this land!" - Hoban "Wash" Washburne

People decide to give you a piece of land. For free. But since life doesn't work like that, the land is shaped like an ellipsis, so building a house on it is completely out of the question. Instead you, quite understandibly, wonder whether you can turn it into a programming challenge!

You choose \(n\) arbitrary points on the land's boundary and connect every point to every other point using bits of string. After having done so, you wonder into how many pieces you could have divided your piece of land with \(n\) points.


The input contains one line for each test case. Each test case is specified by a single integer \(0 \leq n < 2^{31}\) that specifies the number of points on the boundary of your land. If \(n = -1\), that indicates that there are no more test cases


For each input instance, output the maximum possible number of pieces of land defined by \(n\) points, each printed on its own line.

Sample Input


Sample Output


This is challenge 10213 of the ACM International Collegiate Programming Contest. Test input is provided by uDebug.

Upload Solution

Please log in to submit your solution.


Difficulty (1 vote)
Average test runtime 0.17
Points (changes over time) 10
Tried by 7 users
Solved by 4 users

Global ranking

# Name Runtime Points worth
1 Pascal 0.14 11
2 贝尔恩德 0.14 11
3 Mac 0.14 11
4 Dark 0.26 6