
def findtrips(weights,bsum):
	n = len(weights)
	weights.sort()
	count = 0
	first , second = 0 , n - 1
	while first <= second:
	    total = weights[first] + weights[second]
	    if total <= bsum:
	        first += 1
	    second -= 1
	    count += 1
	return count

weights = [1.1, 1.1, 1.1, 1.4, 2.4]
bsum = 3

print(findtrips(weights,bsum))




