$$W=F*d*cos\theta$$ where F=force ,d=distance and $$\theta$$ is the angle between F and d so the W would be maximum when $$cos\theta$$=1 of $$\theta$$=0