Can someone please help me out on the below problem?

PROBLEM: How do we find out the force exerted by A on B ? Will the calculation vary if Body B does not deform? SITUATION: Body A hits body B causing a deformation of body B. Assume B is a cuboid. Known values: 1) Mass of body A 2) Mass of body B 3) Velocity before impact of body A 4) Velocity before impactof body B 5) Dimensions of the B before and after impact (for simplicity sake, let's assume that B has reduced in length by x meters and there is no other change in the dimension) 6) Assume that both body A & B come to rest after impact.