we have an angle of elevation 31 degrees from a distance x from the base of the building
we have an angle of elevation 17 degrees from a distance x+50 from the base of the building
(distance in meters) we have tan31 = h/x = 0.6008 --->>> h=0.6008x (h is the heigh of the building)
we have tan17=h/(x+50) = 0.3057 --->>> h=0.3057(x+50) h=0.3057x + 15.285
so we have 0.6008x = 0.3057x + 15.285 ---->>>. 0.2951x = 15.285 --->>> x = 15.285 / 0.2951 = 51.796
so the h = 0.6008x = 0.6008 * 51.796 = 31.119 so heigh of the building = 31.119 m (approx)
the same result of course we have from h=0.3057(51.796)+15.285 = 31.119 m (approx)