human
Number of pairs of lines having integer intersection points | Count number of pairs of lines having eger ersection po.
Initialize arrays to store counts.
Count number of odd and even Pi.
Count number of odd and even Qi.
Return the count of pairs.
Driver code"
Solution in Python:
 ... Write me a code to number of pairs of lines having integer intersection points and the other steps required?
assistant
#Here is code to number of pairs of lines having integer intersection points and the other steps required.
 def countPairs ( P , Q , N , M ) :
	A = [ 0 ] * 2
	B = [ 0 ] * 2
	for i in range ( N ) :
		A [ P [ i ] % 2 ] += 1
	for i in range ( M ) :
		B [ Q [ i ] % 2 ] += 1
	return ( A [ 0 ] * B [ 0 ] + A [ 1 ] * B [ 1 ] )
P = [ 1 , 3 , 2 ]
Q = [ 3 , 0 ]
N = len ( P )
M = len ( Q )
print ( countPairs ( P , Q , N , M ) )