## Welcome To SDIBT ACM-ICPC Online Judge

Problem 1055. -- How Many Pieces of Land? ## How Many Pieces of Land?

Time Limit: 1 Sec Memory Limit: 64 MB

Submit: 0 Solved: 0

[Submit][Status][Discuss]## Description

You are given an elliptical-shaped land and you are asked to choose n arbitrary points on its boundary. Then you connect each point with every other point using straight lines, forming n(n - 1)/2 connections. What is the maximum number of pieces of land you will get by choosing the points on the boundary carefully?
Dividing the land when n = 6.

## Input

The first line of the input file contains one integer s (0 < s < 3, 500), which indicates how many input instances there are. The next s lines describe s input instances, each consisting of exactly one integer n (The first line of the input file contains one integer s (0 < s < 3, 500), which indicates how many input instances there are. The next s lines describe s input instances, each consisting of exactly one integer n (0<=n <2^{31}).

## Output

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

## Sample Input

4
1
2
3
4

## Sample Output

1
2
4
8

## HINT

## Source

[Submit][Status][Discuss]

HOME
Back

한국어 中文 English

All Copyright Reserved 2008-2010 SDIBT TEAM

GPL2.0 2003-2010 HUSTOJ Project TEAM

Anything about the Problems, Please Contact Admin:admin