cube-change-qualifier2

Chandan gave his son a  cube with side N. The N X N X N cube is made up of small 1 X 1 X 1 cubes.

Chandan's son is extremely notorious just like him. So he dropped the cube inside a tank filled with Coke. The cube got totally immersed in that tank. His son was somehow able to take out the cube from the tank. But sooner his son realized that the cube had gone all dirty because of the coke. Since Chandan did not like dirty stuffs so his son decided to scrap off all the smaller cubes that got dirty in the process. A cube that had coke on any one of its six faces was considered to be dirty and scrapped off. After completing this cumbersome part his son decided to calculate  volume of the scrapped off material.
Since Chandan's son is weak in maths he is unable to do it alone.

Help him in calculating the required volume.

Input:

The first line contains T denoting the number of test cases. Then T lines follow each line contains N that is the side of cube.

Output:

For each case output the required volume.

Constraints:

1 ≤ T ≤ 100
1 ≤ N ≤ 10^9
Note:

There is no hole or space between 2 smaller cubes.

SAMPLE INPUT
2
1
3

SAMPLE OUTPUT
1
26

Explanation

For the first test case : There is only 1 small cube in a 1 x 1 x 1 cube. This cube gets coke on all of its 6 faces so it needs to be scrapped off. Volume of material that gets scrapped is 1 x 1 x 1 = 1.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
for _ in range(int(input())):
	N = int(input())
	if N == 1:
		print(1)
	else:
		print(N**3-(((N-2)**2)*(N-2)))


test_cases=int(input(""))
for test_case in range(test_cases):
	sides=int(input(""))
	if sides==1:
		print(1)
	else:
		print(6*pow(sides, 2)-12*sides+8)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''

a=eval(input())

for i in range(0,a):
	b=eval(input())
	if b==1 :
		print(1)
	else:
		print(2*(3*b*(b-2)+4))
		



t=int(input())
ans=[]
for i in range(t):
	N=int(input())
	if N==1:
		ans.append(1)
	elif N==2:
		ans.append(8)
	else:
		val3=int(N*N*N)
		val2=int((N-2)*(N-2)*(N-2))
		val=val3-val2
		ans.append(val)
for x in ans:
	print(x)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
for t in range(eval(input())):
	n = eval(input())
	if n==1:
		print(1)
	else:
		print(n*n*n-(n-2)*(n-2)*(n-2))


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''

testcases=int(input())

testdata=[]
for i in range(0,testcases):
	testdata.append(int(input()))

for i in range(0,len(testdata)):
	if(testdata[i]<=1):
		print(1)
	else:
	  print((int(testdata[i]**3)-int((testdata[i]-2)**3)))


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
tc = int(input())
if tc>=1 and tc<=100:
	for i in range(0,tc,1):
		side = int(input())
		if side>1 and side<=(pow(10,9)):
			sside = side - 2
			tvol = side * side * side
			dvol = sside * sside * sside
			svol = tvol - dvol
			print(svol)
		elif side==1:
			print("1")
		else:
			print("Constraint Violation")
else:
	print("Constraint Violation")


t=eval(input())
while t>0:
	n=eval(input())
	if n==1:
		print(1)
	if n==2:
		print(8)
	if n>=3:
		print((pow(n,3)-pow(n-2,3)))
	t-=1


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
t=eval(input())
while t>0:
	t-=1
	n=eval(input())
	if n==1:
		print("1")
	else:
		print(n**3-(n-2)**3)
	


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
t=eval(input())
while t>0:
	t-=1
	n=eval(input())
	if n==1:
		print("1")
	else:
		print(n**3-(n-2)**3)
	


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''

testcases=int(input())

testdata=[]
for i in range(0,testcases):
	testdata.append(int(input()))

for i in range(0,len(testdata)):
	if(testdata[i]<=1):
		print(1)
	else:
	  print((int(testdata[i]**3)-int((testdata[i]-2)**3)))


t=int(input())
while t>0:
	t-=1
	n=int(input())
	if n<=2:
		print(n*n*n)
	else:
		print(n*n*n-(n-2)*(n-2)*(n-2))


t=int(input())
for i in range(t):
	n=int(input())
	if n==1:print(1)
	else:print((n**3-(n-2)**3))