The problem is:
$W$ is a positive integer when divided by $5$ gives remainder $1$ and when divided by $7$ gives remainder $5$. Find $W$.
Answer: Take the larger divisor , So Expression becomes $7k+5$. Now this number when divided by $5$ gives remainder $1$ so expression becomes $7k+4$ which is divisible by $5$. Now plugging in values for $k$ as $0,1,2,..$ we get $7(3)+4$ which is divisible by $5$ so $k=3$.
I know that $\frac{W}{5} => remainder~1$ so $5q+1=W$
$\frac{W}{7} => remainder~5$ so $7k+5=W$
Edit: Now I know that $5q+1 = 7k+5$
This implies $q=\frac{7k+4}{5}$
Now how did the text assume that $7k+4$ is divisible by $5$ and there would be no remainder?