|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||128 MB||304||100||81||31.034%|
On the first day of Christmas, my true love gave to me, a partridge in a pear tree.
Great. I wanted an iPad.
On the second day of Christmas, my true love gave to me, two turtle doves, and a partridge in a pear tree.
OK, now I have 4 birds: two turtle doves and a partridge today, and a partridge from yesterday. My cats are going crazy.
On the third day of Christmas, my true love gave to me, three french hens, two turtle doves, and a partridge in a pear tree.
What's with the birds? I now have ten of them, and no place to put them (except insidethe cats). How long can my true love keep this up?
Given a number of days of Christmas, figure out the total number of gifts I'm going to receive.
There will be several test cases in the input. Each test case will consist of a single integer n (1≤n≤1,000,000), on its own line. The input will end with a line with a single 0.
For each test case, output a single integer, indicating the number of gifts I’m going to receive, in total. Output no spaces, and do not separate answers with blank lines.
1 2 3 0
1 4 10