chandu-and-his-playing-area

Little chandu is very fond of playing games. Recently, He found a few straws each of length 1 inches in the store room. He took all of them and decided to mark a rectangular area on the floor with straws and warn rest of the family members to not to enter that area so that he can play in peace. He wants to maximize that area. But, unable to do so, He seeks for your help. You being the elder brother of chandu, write a program for him to find maximum area that he can cover in inches using N straws.

Input:

First line of input contains an integer t. then, t lines follow each containing a single integer N - No of straws.

Output:

Print the area of largest rectangle that can be formed using the given sticks.

Constraints:

0 ≤ t ≤ 25000  

1 ≤ N ≤ 10^{10}  

SAMPLE INPUT
3
6
9
11

SAMPLE OUTPUT
2
4
6

Difficulty: EASY
Tags: Mathematics

Ad-hoc

Starter code:

Solutions:
a=int(input())
for i in range(a):
	n=int(input())
	#print 'n is %d' % n
	flag='N'
	l=n/4

	#print 'l is %d' % l
	x=(n-2)/4
	b=x+1

	#print 'x is %d ' % x
	#print 'printing %s' % (2*x+2*b)
	if 2*x+2*b <= n and  x*b > l*l:
		flag='Y'
		#print 'flag is set'

	if flag =='Y':
		print(x*b)
	else:
		print(l*l)


T = int(input())

for ii in range(T):
	N = int(input())
	h = N/2
	if h%2 == 0:
		a = h/2
		b = a
	else:
		a = h/2
		b = a+1
	print(a*b)


t=input()
t=int(t)
while(t):
	n=input()
	n=int(n)
	if(n%2==0):
		n=n/2
		if(n%2==0):
			print(((n/2) * (n/2)))
		else:
			print(((n/2)*(n/2+1)))
	elif(n%2!=0):
		n=n-1
		if(n%2==0):
			n=n/2
			if(n%2==0):
				print(((n/2) * (n/2)))
			else:
				print(((n/2)*(n/2+1)))
		
	t=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:
	n=eval(input())
	l=n//4
	r=n-(2*l)
	b=r//2
	a=l*b
	print(a)
	t-=1


t = eval(input())

for i in range(t):
	n = eval(input())
	side = int(n/4)
	if n%4>1:
		print(side*(side+1))
	else:
		print(side*side)


import sys,math
t=eval(input())

while t>0:
	n=eval(input())
	if n%2==0:
		 print(int(math.ceil(n/4.0)*math.floor(n/4.0)))
	else:
		 n=n-1
		 print(int(math.ceil(n/4.0)*math.floor(n/4.0)))
	t=t-1


def s():
	n = int(eval(input()))
	for j in range(n):
		i = int(eval(input()))
		i = int(i/2)
		if(i%2==0):
			print(i/2*i/2)
		else:
			print(int(i/2+1)*int(i/2))
		

if __name__ == '__main__':
	s()


a=int(input())
for i in range(a):
	n=int(input())

	flag='N'
	l=n/4

	#print 'l is %d' % l
	x=(n-2)/4
	b=x+1

	#print 'x is %d ' % x
	#print 'printing %s' % (2*x+2*b)
	if 2*x+2*b <= n and  x*b > l*l:
		print(x*b)
		flag='Y'
	else:
		print(l*l)


import math
t = int(input())

for i in range(t):
	n = int(input())
	side = int(n/4)
	if n%4>1:
		print(side*(side+1))
	else:
		print(side**2)


n=eval(input())
l=[]
for i in range(n):
	l.append(eval(input()))

def area(x):
	a=x/2
	if a%2==0:
		print((a/2)**2)
	else:
		print((a/2)*((a+1)/2))

for i in l:
	area(i)


t_case = int(input())
for i in range(t_case):
	n=int(input())
	t1=n/4
	t2=n%4
	if t2==0 or t2==1:
		print(t1*t1)
	else:
		print((t1+1)*t1)	


def max_area(n):
	a=n//2
	if(a%2==0):
		print(((a//2)*(a//2)))
	else:
		print(((a//2)*((a+1)//2)))

#main
tst=int(eval(input()))

while(tst):
	n=int(eval(input()))
	max_area(n)
	tst=tst-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):
	t-=1
	n=eval(input())
	k=n/2
	print(k*k/4)
		


p = input()
k = int(p)
while(k > 0):
	k = k-1
	j  = int(input())
	l = j/4
	n = (j-2*l)/2
	print(l*n)


t = int(input())
for i in range(t):
	n = int(input())
	if n<4:
		print(0)
	elif n%2 == 0:
		if n%4 == 0:
			print((n/4)**2)
		else:
			n = (n-2)/4
			print(n*(n+1))
	else:
		if (n-1)%4 == 0:
			n = (n-1)/4
			print(n**2)
		else:
			n = (n+1)/4
			print(n*(n-1))


tc = eval(input())
while tc > 0:
	n = eval(input())
	if n&0o1 == 1: n -= 1
	print(n*n/16)
	tc -=1


for i in range(int(input())):
	n=int(input())
	if (n%2==1):
		n=n-1
	n=n/2
	ans= (n//2)*(n-(n//2))
	print(ans)


t = input()
t= int(t)
for i in range(t):
	n=input()
	n= int(n)
	n = n/2
	if(n%2 == 0):
		print(n*n/4)
	else:
		print((n-1)*(n+1)/4)


import math

sets = int(input());

for i in range(0, sets):
	straw = int(input())
	width = int(math.floor(straw / 4))
	height = int(math.floor((straw - (width * 2)) / 2))
	
	print(width * height)


p = input()
k = int(p)
while(k > 0):
	k = k-1
	j  = int(input())
	l = j/4
	n = (j-2*l)/2
	print(l*n)


p = input()
k = int(p)
while(k > 0):
	k = k-1
	j  = int(input())
	l = j/4
	n = (j-2*l)/2
	print(l*n)


testcases=int(input())
for i in range(testcases):
	n=int(input())
	n=int(n/2)
	if (n%2==0):
		print((n*n)/4)
	else:
		print((n*n-1)/4)


p = input()
k = int(p)
while(k > 0):
	k = k-1
	j  = int(input())
	l = j/4
	n = (j-2*l)/2
	print(l*n)


t = int(input())

for i in range(t):
	n = int(input())
	side = int(n/4)
	if n%4>1:
		print(side*(side+1))
	else:
		print(side*side)


t=eval(input())
for _ in range(t):
	n=eval(input())
	if n<4:
		print(0)
	else:
		r=n%4
		if r==0:
			print(((n/4)*(n/4)))
		else:
			r=(n-1)%4
			if r==0:
				print((((n-1)/4) * ((n-1)/4)))
			else:
				r=n/4
				print(r*(r+1))