mgh = energy of hammer delivered to pile = 150*9.8*5 = 7350 j
 Amount delivered to the pile  400kg x 9.8 x .0075=400*9.8*.0075 = 29.4 j
 The difference is delivered to the ground (vibrations, ground movement, heat of friction etc) and is the resistance (?)
 7350-29.4 = 7320.6 j
  
 (a little unsure)