Initial velocity of the rocket, v = 2 km/s = 2 × 103 m/s
Mass of Mars, M = 6.4 × 1023 kg
Radius of Mars, R = 3395 km = 3.395 × 106 m
Universal gravitational constant, G = 6.67× 10–11 N m2 kg–2
Mass of the rocket = m

If 20 % of initial kinetic energy is lost due to Martian atmospheric resistance, then only 80 % of its kinetic energy helps in reaching a height

Maximum height reached by the rocket = h
At this height, the velocity and hence, the kinetic energy of the rocket will become zero.
Total energy of the rocket at height h 
Applying the law of conservation of energy for the rocket, we can write:

