A town has 2017 houses. Of these 2017 houses, 1820 have a dog, 1651 have a cat, and 1182 have a turtle. If $x$ is the largest possible number of houses that have a dog, a cat, and a turtle, and $y$ is the smallest possible number of houses that have a dog, a cat, and a turtle, then $x-y$ is
(A) 1182
(B) 638
(C) 563
(D) 619
(E) 466
Since there are 1182 houses that have a turtle, then there cannot be more than 1182 houses that have a dog, a cat, and a turtle.

Since there are more houses with dogs and more houses with cats than there are with turtles, it is possible that all 1182 houses that have a turtle also have a dog and a cat.

Therefore, the maximum possible number of houses that have all three animals is 1182, and so $x=1182$.

Since there are 1182 houses that have a turtle and there are 2017 houses in total, then there are $2017-1182=835$ houses that do not have a turtle.

Now, there are 1651 houses that have a cat.

Since there are 835 houses that do not have a turtle, then there are at most 835 houses that have a cat and do not have a turtle. In other words, not all of the houses that do not have a turtle necessarily have a cat.

This means that there are at least $1651-835=816$ houses that have both a cat and a turtle. Lastly, there are 1820 houses that have a dog.

Since there are at least 816 houses that have both a cat and a turtle, then there are at most $2017-816=1201$ houses that either do not have a cat or do not have a turtle (or both).

Since there are 1820 houses that do have a dog, then there are at least $1820-1201=619$ houses that have a dog and have both a cat and a turtle as well.

In other words, the minimum possible number of houses that have all three animals is 619 , and so $y=619$.

The two Venn diagrams below show that each of these situations is actually possible:
![](https://cdn.mathpix.com/cropped/2024_04_20_faa9db06d997f2a5b9b1g-072.jpg?height=596&width=1286&top_left_y=1264&top_left_x=476)

Since $x=1182$ and $y=619$, then $x-y=563$.

ANSWER: (C)