10213-how Many Pieces of land?
Time limit:3.000 seconds
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem= 1154
You are given a elliptical shaped land and your are asked to choose N arbitrary in its points. Then you connect all of these points with one another with straight lines (that's N. (n-1)/2 connections for n points). What is the maximum number of pieces for you'll get by choosing the points on the boundary carefully?
Fig:when the value of n is 6.
Input
The ' the ' input file contains one integer S (0 < s < 3500), which indicates how many sets of input are T Here. The next S lines contain ssets of input. Each input contains one integer N (0<=n<2^31).
Output
For each set of input, should output in a single line the maximum number pieces, possible to get for the value O F N.
Sample Input:
4
1
2
3
4
Sample Output:
1
2
4
8
A good question on the P86, I've worked out the formula O (1).