it must be D.
The subnet 255.255.31.0 belongs to Class B, since its net id is 255.255 .
So, we can conclude that either option could be (A) or (D).
Now, the question asks that the the IP should be same network, so, to test that the IP are in same network we check that whether their netwrok address is same, by using AND operation.
IP AND MASK = network address
In case of option A, we can see that when we apply AND operation to first byte of IP and first byte of MASK both the IP will give same, but when we apply AND operation is applied on second byte then both the IP gives different. So, option A is eliminated and hence Option D is selected because both IP has first and second IP as same.