Number of nonnegative integer quintuples that $x^2+y^2+z^2+w^2+v^2=40$ 
How many quintuples ($5$-pairs) that are consisting of nonnegative integers that satisfy:
  $$x^2+y^2+z^2+w^2+v^2=40$$
$A)\space 56$
$B)\space 66$
$C)\space 112$
$D)\space 120$
$E)\space 122$

I don't know what to try. Should I count them? Or is there some theorem?

The largest integer is clearly at most $6$.
Suppose the largest is exactly $6$. Then the other four squares must add to $4$, which can occur if they are all $1$ or if one is $2$ and the others are all $0$. So the two solution shapes in this case are $(1,1,1,1,6)$ and $(0,0,0,2,6)$.
Suppose the largest is exactly $5$. Then the other four squares must add to $15$. At least one of these squares must be $9$ (by quick check), so the three remaining squares must add to $6$. This can only be done as $1 + 1 + 4$. In this case, there is one solution shape, namely $(1,1,2,3,5)$.
Suppose the largest is exactly $4$. Then the remaining four squares must add to $24$. If another square is $4$, then three squares must add to $8$, which can only be done as $0+4+4$. Alternately, if the second largest square is $3$, then the three remaining squares must add to $15$, but this cannot occur (as noted above). Thus in this case, there is only the solution shape $(0,2,2,4,4)$.
If the largest is exactly $3$, then it's apparent that the only available solution shape is $(2,3,3,3,3)$ (by quick check, similar to above).
As the largest integer must be greater than $3$, this classifies all solution shapes.
What remains is to count how many of each solution shape there actually are. For instance, in $(1,1,1,1,6)$, it's apparent that any of the five integers can be chosen as $6$, and so on. It's quick to do this for each solution shape, but I leave the counting to you.
