import numpy as np
# Create a 3x4 NumPy array with specified values
X = np.asarray([[1.0, 0.0, 3.0, 8.0],[2.0, 0.0, 1.0, 1.0],[1.5, 2.5, 1.0, 0.0]])
n = 4

# Check if all elements of X are integers
M = np.logical_and.reduce(np.mod(X, 1) == 0, axis=-1)

# Check if sum of each row of X is equal to n
M &= (X.sum(axis=-1) == n)
print(X[M])