human
Length and Breadth of rectangle such that ratio of Area to diagonal ^ 2 is maximum | function to print length and breadth.
sort the input array.
create array vector of integers occurring in pairs.
push the same pairs.
calculate length and breadth as per requirement.
check for given condition.
print the required answer.
Driver Code"
Solution in Python:
 ... Can you provide a code to length and Breadth of rectangle such that ratio of Area to diagonal ^ 2 is maximum and the other steps required?
assistant
#Here is code to length and Breadth of rectangle such that ratio of Area to diagonal ^ 2 is maximum and the other steps required.
 def findLandB ( arr , n ) :
	arr . sort ( reverse = False )
	arr_pairs = [ ]
	for i in range ( n - 1 ) :
		if ( arr [ i ] == arr [ i + 1 ] ) :
			arr_pairs . append ( arr [ i ] )
			i += 1
	length = arr_pairs [ 0 ]
	breadth = arr_pairs [ 1 ]
	size = len ( arr_pairs )
	for i in range ( 1 , size - 1 ) :
		if ( ( int ( length / breadth ) + int ( breadth / length ) ) > ( int ( arr_pairs [ i ] / arr_pairs [ i - 1 ] ) + int ( arr_pairs [ i - 1 ] / arr_pairs [ i ] ) ) ) :
			length = arr_pairs [ i ]
			breadth = arr_pairs [ i - 1 ]
	print ( length , " , " , breadth )
if __name__ == ' _ _ main _ _ ' :
	arr = [ 4 , 2 , 2 , 2 , 5 , 6 , 5 , 6 , 7 , 2 ]
	n = len ( arr )
	findLandB ( arr , n )