7831: CCC '08 S2 - Pennies in the Ring
[Creator : ]
Description
Canadian Computing Competition: 2008 Stage 1, Senior #2
The game "Pennies in the Ring" is often played by bored computer programmers who have gotten tired of playing solitaire. The obInput
The input is a sequence of positive integer values, one per line, where each integer is the radius of a circle. You can assume the radius will be less than or equal to 25000. The last integer will be indicated by 0. You may assume that the grid is large enough for two pennies to be on adjacent integer coordinates and not touch.
Output
You are to output, each on its own line, the number of pennies needed for each circle. You do not need to output 0 for the last 0. You may assume that the number of possible pennies is less than 2 billion (which is only $20 million dollars: computer scientists have lots of money).
Sample 1 Input
2
3
4
0
Sample 1 Output
13
29
49