human
Sum of given N fractions in reduced form | Function to find GCD of a & b using Euclid Lemma.
Base Case.
Function to find the LCM of all elements in arr [ ].
Initialize result.
Iterate arr [ ] to find LCM.
Return the final LCM.
Function to find the sum of N fraction in reduced form.
To store the sum of all final numerators.
Find the LCM of all denominator.
Find the sum of all N numerators & denominators.
Add each fraction one by one.
Find GCD of final numerator and denominator.
Convert into reduced form by dividing from GCD.
Print the final fraction.
Given N.
Given Numerator.
Given Denominator.
Function call"
Solution in Python:

Give me a code to sum of given N fractions in reduced form and the other steps required?
assistant
#Here is code to sum of given N fractions in reduced form and the other steps required.
 def gcd ( a , b ) :
	if ( b == 0 ) :
		return a
	return gcd ( b , a % b )
def findlcm ( arr , n ) :
	ans = arr [ 0 ]
	for i in range ( 1 , n ) :
		ans = ( ( ( arr [ i ] * ans ) ) // ( gcd ( arr [ i ] , ans ) ) )
	return ans
def addReduce ( n , num , den ) :
	final_numerator = 0
	final_denominator = findlcm ( den , n )
	for i in range ( n ) :
		final_numerator = ( final_numerator + ( num [ i ] ) * ( final_denominator // den [ i ] ) )
	GCD = gcd ( final_numerator , final_denominator )
	final_numerator //= GCD
	final_denominator //= GCD
	print ( final_numerator , " / " , final_denominator )
N = 3
arr1 = [ 1 , 2 , 5 ]
arr2 = [ 2 , 1 , 6 ]
addReduce ( N , arr1 , arr2 )