In a certain apartment building, residents are allowed to own exactly one dog, exactly one cat, or one dog and one cat. No other pets are allowed. There are 22 cats and 17 dogs in the building. If there are 25 apartments that contain only one dog or one cat, how many apartments, in total, contain pets?

(A) 27

(B) 32

(C) 35

(D) 39

(E) 42Thank you. 🙂

Hey, I know this question! I wrote it!

Start by drawing a Venn diagram:

The equations you can write are as follows:

*x* + *y* = 17

*y* + *z* = 22

*x* + *z* = 25

That last one comes from what the question tells you about how many apartments contain only one dog or only one cat.

Anyway, the number you *want* is *x* + *y* + *z*. The easiest way to get that is to add ALL THREE equations together:

(*x* + *y*) + (*y* + *z*) + (*x* + *z*) = 17 + 22 + 25

2*x* + 2*y* + 2*z* = 64

Now just divide everything by 2 to get your answer!

*x* + *y* + *z* = 32