First you will want to sketch out both of the situations. It should be two sketches, one for the flagpole and one for the building.
To solve this, you will want to create a proportion.
Flagpole height/flagpole shadow=building height/building shadow
Therefore, it should look like this:
50/30= 300/x
Solve for x:
50x=9,000
X= 180 feet
YOUR ANSWER IS C.