human
Give me a code to count even sum pairs possible by selecting two integers from two given ranges respectively and the other steps required given the following:
Count even sum pairs possible by selecting two integers from two given ranges respectively | Function to count even sum pairs in the given range.
Stores the count of even numbers between 1 to X.
Stores the count of odd numbers between 1 to X.
Stores the count of even numbers between 1 to Y.
Stores the count of odd numbers between 1 to Y.
Stores the count of pairs having even sum.
Returns the count of pairs having even sum.
Driver code"
Solution in Python:
assistant
#Here is code to count even sum pairs possible by selecting two integers from two given ranges respectively and the other steps required.
 def cntEvenSumPairs ( X , Y ) :
	cntXEvenNums = X / 2
	cntXOddNums = ( X + 1 ) / 2
	cntYEvenNums = Y / 2
	cntYOddNums = ( Y + 1 ) / 2
	cntPairs = ( ( cntXEvenNums * cntYEvenNums ) + ( cntXOddNums * cntYOddNums ) )
	return cntPairs
X = 2
Y = 3
print ( cntEvenSumPairs ( X , Y ) )