nikhil-and-boxes

Nikhil has some boxes and balls. He now wonders how large a ball he can fit in a given box. Given the dimensions of a box, help Nikhil determine the radius of the largest ball that he can fit in the box. Assume that an inflated ball will be spherical.

Input:-

The first line of the input will be T, the number of test cases. Next follows T lines each containing three space separated integers (L, B, H) which are the length, breadth and height of the box respectively.

Output:-

Print T lines each consisting of the radius(correct to 1 decimal place) of the largest ball that Nikhil can fit in the box of dimensions corresponding to each test case.

Constraints:

1 ≤ T ≤ 10^5 
1 ≤ L, B, H ≤ 10^18

SAMPLE INPUT
2
1 2 3
3 3 7

SAMPLE OUTPUT
0.5
1.5

Source: hackerearth | Difficulty: MEDIUM
Tags: Dynamic programming

Mathematics


Solutions:
import sys
T = int(eval(input()))
for i in range(0, T):
	l,b,h = list(map(float,sys.stdin.readline().split()))
	k = min(l,b,h)
	print(("%.1f" % (k/2)))


for _ in range(eval(input())):
	a,b,c=list(map(int,input().split()))
	print("%.1f" %(float(min(a,b,c))/2))


import sys
for _ in range(int(eval(input()))):
	l,b,h = list(map(float,sys.stdin.readline().split()))
	if(l<b and l<h):
		print("%0.1f"%(l/2))
	elif(b<h and b<l):
		print("%0.1f"%(b/2))
	elif(h<l and h<b):
		print("%0.1f"%(h/2))
	elif(l==b and l<h):
		print("%0.1f"%(l/2))
	elif(l==h and l<b):
		print("%0.1f"%(l/2))
	elif(b==h and b<l):
		print("%0.1f"%(h/2))
	elif(l==b and l==h):
		print("%0.1f"%(l/2))


for _ in range(eval(input())):
	d=list(map(int,input().split()))
	a=min(d[0],d[1],d[2])
	a=a/2.0
	print("%.1f"%a)