Shinchan and Higure Rakshas

0

0 votes
Euler's Formula, Easy, Number Theory
Problem

Yesterday Action Kamen was captured by Higure Rakshas. Shinchan being a big fan of Action Kamen went to Higure Territory to save him. Higure Territory is an island in a disc shape. To trick Shinchan, Higure has divided his territory in an abnoxious manner. Their are N Gates at the periphery of the island which join all other gates with roads. It is known that no more than 2 roads meet at the same point. These roads divide the island into several sectors. Shinchan after rescuing Action Kamen wants to destroy the whole territory. Help shinchan find the minimum number of bombs needed to destroy the whole island if a bomb can only destroy a single sector.

Input:
First line of input takes number of test cases T. Each test case takes N, the number of Gates on the periphery of the island.

Output:
Print minimum number of Bombs required to destroy the whole Higure territory.

Constraint:
1<=T<=100
1<=N<=500

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

1: enter image description here

For n=4, there are 8 sectors so to destroy it completely sinchan needs 8 bombs.

Editor Image

?