You can indeed use similar triangles to get a side of another similar triangle.
let's say Edwardo stood next to the building and his shadow was 20ft, he's 4ft tall, and the building cast a shadow of 125ft, then, check the picture below.
There are 4 quarts in a gallon. So 8 gallons is the same as 32 quarts.
If he used all but 1 quart, that means he used 31 quarts.
Answer:
31 quarts
Hoped that helped