I am wondering if the following assertion is true:
Let $K$ and $G$ be finite groups such that all subgroups of their direct product $K\times G$ are of the form $L\times H$ for some subgroups $L$ of $K$ and $H$ of $G$. Then the orders of $K$ and $G$ are coprime.
I know that the converse is true but I do not know how the above assumption gives information about the orders of $K$ and $G$. I tried to find integers $a$ and $b$ such that $|K|\cdot a + |G|\cdot b = 1$, which is equivalent to saying that the greatest common divisor of $|K|$ and $|G|$ is $1$ (Bézout's identity). However, I have not yet got something useful.
Many thanks for any help!