human
Count of Multiples of A , B or C less than or equal to N | Function to return the gcd of a and b.
Function to return the count of integers from the range [ 1 , num ] which are divisible by either a , b or c.
Calculate the number of terms divisible by a , b and c then remove the terms which are divisible by both ( a , b ) or ( b , c ) or ( c , a ) and then add the numbers which are divisible by a , b and c.
Driver code"
Solution in Python:
 Write me a code to count of Multiples of A , B or C less than or equal to N and the other steps required?
assistant
#Here is code to count of Multiples of A , B or C less than or equal to N and the other steps required.
 def gcd ( a , b ) :
	if ( a == 0 ) :
		return b ;
	return gcd ( b % a , a ) ;
def lcm ( x , y ) :
	return ( x * y ) // gcd ( x , y )
def divTermCount ( a , b , c , num ) :
	return ( num // a + num // b + num // c - num // lcm ( a , b ) - num // lcm ( c , b ) - num // lcm ( a , c ) + num // ( lcm ( lcm ( a , b ) , c ) ) )
if __name__ == " _ _ main _ _ " :
	a = 7 ; b = 3 ; c = 5 ; n = 100 ;
	print ( divTermCount ( a , b , c , n ) ) ;