Solution:
Let the polygons have $m$ and $n$ sides respectively.
We know that an $p$ sided polygon has $\dfrac{p^2 - 3p}{2}$ diagonals.
Therefore, the first polygon has:
$m$ red sides and $\dfrac{m^2 - 3m}{2}$ green diagonals, while the second polygon has
$n$ green sides and $\dfrac{n^2 - 3n}{2}$ red diagonals.
-----------book page break-----------
Therefore, the total number of the red lines is:
$m + \dfrac{n^2 - 3n}{2}$ and the total number of green lines is $n + \dfrac{m^2 - 3m}{2}$
Therefore,
$m + \dfrac{n^2 - 3n}{2} = 103$
$\Rightarrow \dfrac{2m + n^2 - 3n}{2} = 103$
$\Rightarrow$ $2m + n^2 - 3n = 206$ $... eqn(i)$
Similarly, using the red lines we get:
$2n + m^2 - 3m = 160$ $... eqn(ii)$
Subtracting $eqn(ii)$ from $eqn(i)$ we get:
$2m - 2n + n^2 - m^2 - 3n + 3m = 46$
$\Rightarrow 5(m - n) - (m^2 - n^2) = 46$
$5(m - n) - (m-n)(m + n) = 46$
$(m - n)\{5 - (m + n)\} = 46$
Now we can solve this equation the conventional way, which will make it quite complex. But we can use common observation to solve this equation much more easily.
$m$ and $n$ are the number of sides of two polygons, hence each of them has to be a positive integer, greater than or equal to $3$.
Therefore,
$m + n \ge 6$, hence $5 - (m + n)$ is a negative number. Since the right hand side of $eqn(iii)$ is positive, we can rewrite it as:
$(n - m)(m + n - 5) = 46$
-----------book page break-----------
Since $n$ and $m$ are positive integers both the factors on the left hand side must be integers, and we know that the only ways to factor $46$ are as follows:
$I)\ 1 \times 46$
$II)\ 2 \times 23$
$III)\ 23 \times 2$
$IV)\ 46 \times 1$
$\underline{Case:\ 1}$
$n - m = 1$
$m + n - 5 = 46$
Adding the two we get:
$2n - 5 = 47$
$n = 26$
$m = 25$
Substituting the values of $m$ and $n$ on the left hand side of $eqn(i)$ we get:
$2m + n^2 - 3n$
$= 2(25) + 26^2 - 3(26)$
$= 50 + 676 - 52$
$= 674$
Since this values do not satisfy our equations, we will not consider these values.
$\underline{Case:\ 2}$
$n - m = 2$
$m + n - 5 = 23$
Therefore,
$2n = 30 \Rightarrow n = 15$
$m = 13$
-----------book page break-----------
Substituting these values of $m$ and $n$ on the left hand side of $eqn(i)$ we get:
$2m + n^2 - 3n$
$= 2(13) + 15^2 - 3(15)$
$= 26 + 225 - 45$
$= 206$
These value satisfy the equation.
Again substituting these values in $eqn(ii)$ we get:
$2n + m^2 - 3m$
$= 2(15) + 13^2 - 3(13)$
$= 30 + 169 - 39$
$= 30 + 169 - 39$
$= 160$
These values satisfy this equation as well.
Since these values satisfy both equations, these are valid values.
$\underline{Case:\ 3}$
$n - m = 23$
$m + n - 5 = 2$
Therefore,
$n = 15$
$m = -8$
In this case $m$ is negative, which is not a valid value for sides of a polygon. Hence we will not consider this case.
-----------book page break-----------
$\underline{Case:\ 4}$
$n - m = 46$
$m + n - 5 = 1$
Therefore,
$n = 26$
$m = -8$
In this case $m$ is negative, which is not a valid value for sides of a polygon. Hence we will not consider this case.
Since out of the four cases, only $Case:\ 2$ satisfies both the equations the valid values for $m$ and $n$ are $13$ and $15$
Therefore the correct answer is $13 + 15 = 28$