The correct option is D depends on both horizontal and vertical components of displacement.
Let the work done by the force F be WF.
If the body slips over a rough surface such that normal reaction of the surface has to balance only the normal component of weight of the body, then the energy lost against friction depends only upon the horizontal component of displacement and is equal to WFriction=−μmgx, where x is the horizontal component of displacement. It does not depend on the shape of the surface.
If the vertical component of displacement of the body is equal to y, its gravitational potential energy will be equal to WG=−mgy
Apply Work-Energy theorem:
WF+WG+WFriction=ΔKE
(∵ the block is slowly hauled, final and initial velocity = 0)
WF−mgy−μmgx=0
WF=mgy+μmgx
Hence, it depends on horizontal and vertical components of displacement.