\(\text{Well conceptually it's simple enough}\\ n + d + q = 30\\ 5n+10d+25q=500 \\ n+2d+5q=100\)
\(\text{we can take the difference of these two equations to obtain}\\ d + 4q=70\\ q = \dfrac{70-d}{4},~q \in \mathbb{Z^+}+\{0\}\\ \text{and we can now read off the possible $q$'s}\\ (d,q)=(2,17), (6,16),(10,15),(14,14),(18,13),(22,12), (26,11),(30,10)\\ \text{and of these we select those who's sum is 30 or less}\\ (d,q)=(2,17), (6,16),(10,15),(14,14)\\ \text{and we can then fill in $n$}\\ (n,d,q) = (11,2,17), (8,6,16), (5,10,15), (2,14,14) \)
.