Question 1030927
The question is not clear; but still what is unknown in the description can be solved.


First sentence:
{{{40*r*40=1}}}, because the rate for the fourty men is {{{40r}}}, and the ONE "work" would be done in 40 days.


What should be the second sentence composed of two periods of time:
{{{40r*10+(40-5)r*x=1}}}, because the men working in the two time periods of 10 days and x days would do ONE "work".  Notice the {{{40-5}}} for the number of workers for the time period of x days.  That is 35 men working for x days.
-
Solve this equation for x.
{{{400r+35rx=1}}}
{{{35rx=1-400r}}}
{{{highlight_green(x=(1-400r)/(35r))}}}-------very important but not yet the finished formula.
-
The question to ask should be like,  how many days after the 5 men leave the group do the remaining men finish the job?



Look at the first equation now.
{{{40r*40=1}}}
{{{40^2*r=1}}}
{{{r=1/1600}}}-------this is the ONE MAN work rate.   Substitute this into the green-outlined formula for x.  Evaluate.


{{{x=(1-400(1/1600))/(35(1/1600))}}}


{{{x=(1-1/4)/(35/1600)}}}


{{{x=(3/4)(1600/35)}}}

{{{x=(3*4*4*100)/(4*7*5)}}}


{{{x=(3*4*20)/7}}}

{{{x=240/7}}}


Looks like {{{highlight(x=34&2/7)}}}, a fraction of a day more than 34 days.