human
Maximum non | Function to prthe maximum rooks and their positions.
Marking the location of already placed rooks.
Print number of non - attacking rooks that can be placed.
To store the placed rook location.
Print lexographically smallest order.
Driver Code.
Size of board.
Number of rooks already placed.
Position of rooks.
Function call"
Solution in Python:
 ... What is a code to maximum non and the other steps required?
assistant
#Here is code to maximum non and the other steps required.
 def countRooks ( n , k , pos ) :
	row = [ 0 for i in range ( n ) ]
	col = [ 0 for i in range ( n ) ]
	for i in range ( k ) :
		row [ pos [ i ] [ 0 ] - 1 ] = 1
		col [ pos [ i ] [ 1 ] - 1 ] = 1
	res = n - k
	print ( res )
	ri = 0
	ci = 0
	while ( res > 0 ) :
		while ( row [ ri ] == 1 ) :
			ri += 1
		while ( col [ ci ] == 1 ) :
			ci += 1
		print ( ( ri + 1 ) , ( ci + 1 ) )
		ri += 1
		ci += 1
		res -= 1
if __name__ == ' _ _ main _ _ ' :
	N = 4
	K = 2
	pos = [ [ 1 , 4 ] , [ 2 , 2 ] ]
	countRooks ( N , K , pos )