To fill 50 12-fl oz cups, you need 50 * 12 fl oz = 600 fl oz
There are 128 fl oz in a gallon
600/128 = 4.6875
600 fl oz = 4.6875 gallons
600 fl oz is under 5 gallons, so 5 gallons is enough.
1 qt = 32 fl oz
17 qt = 17 * 32 fl oz = 544 fl oz
17 quarts is 544 fl oz, which is under the needed 600 fl oz, so 17 quarts is not enough.
Answer: 5 gallons