human
Print k numbers where all pairs are divisible by m | function to generate k numbers whose difference is divisible by m.
Using an adjacency list like representation to store numbers that lead to same remainder ..
stores the modulus when divided by m.
If we found k elements which have same remainder ..
If we could not find k elements.
driver program to test the above function"
How can the above be solved in Python?

What is a code to print k numbers where all pairs are divisible by m and the other steps required?
assistant
#Here is code to print k numbers where all pairs are divisible by m and the other steps required.
 def print_result ( a , n , k , m ) :
	v = [ [ ] for i in range ( m ) ]
	for i in range ( 0 , n ) :
		rem = a [ i ] % m
		v [ rem ] . append ( a [ i ] )
		if ( len ( v [ rem ] ) == k ) :
			for j in range ( 0 , k ) :
				print ( v [ rem ] [ j ] , end = " ▁ " )
			return
	print ( - 1 )
if __name__ == ' _ _ main _ _ ' :
	a = [ 1 , 8 , 4 ]
	n = len ( a )
	print_result ( a , n , 2 , 3 )