9030 - Blocks   

Description

Given N 1×1×1 cubes, arrange them to form a rectangular solid such that the surface area is minimized.

Input

The first line of the input contains an integer T, which is the number of test cases. Each of the next T lines contains an integer N (N ≤ 10000) denoting the number of cubes.

Output

For each case, output a line containing an integer which is the minimized surface area.

Sample Input  Download

Sample Output  Download

Tags




Discuss