The dynamic deformation of a layered viscoelastic medium under surface excitation