Let's go back to your first attempt. We have the system of equations:
\begin{align}
0 &= 55.575X - 131Y + 0Z \\
0 &= 100.032X + 127.725Y - 98.25Z \\
G &= 122.265X + 0Y + 65.5Z
\end{align}
Now we have four unknowns, but remember we're just trying to find a ratio between $X$, $Y$, and $Z$. This means we can fix any of them at $1$ and find the ratio from there. Let $X=1$, and we will find.
\begin{align}
0 &= 55.575 - 131Y\\
0 &= 100.032 + 127.725Y - 98.25Z \\
G &= 122.265+65.5Z
\end{align}
We can solve this system now, I used WolframAlpha to do so and got $$G=\frac{900307}{4000}, X = 1, Y = \frac{2223}{5240}, Z = \frac{411247}{262000}$$
Now we wish to find integer results for $Y$ and $Z$ so we multiply and find $$262000: 111150: 411247$$ as the ratio $X:Y:Z$.
I've now checked my work by plugging it back into the original equations and find an output of $G = 5.89701\cdot 10^7$.
Happy engineering!
Best Answer
1. Solution to Problem 1
Let's say each person does $x$ amount of work each day. Work done by $18$ men in $42$ days will be equal to constructing $140$ m wall. $$18\times42\times x=140$$
$$\Rightarrow x=\frac{140}{18\times42}$$ and if time taken by $30$ men to build $100$m wall is $y$ then $$30\times y \times x=100$$
$$\Rightarrow y=\frac{100\times42\times18}{30\times140}=18\text{ days}$$
2. Solution to Problem 2
Let there be $x$ males and $y$ females Then we have $$5y=3x$$ $$x-y=40$$
Solving these two equations we get $$x=100 , y=60$$