Suppose the pair $ (k,m) $ satisfies the conditions of the problem.
If the inequality $ m\geq k $ holds, then

$$(m+3)^2=m^2+6m+9>m^2+5m\geq m^2+5k>m^2,$$

and since $ m^2+5k $ is a square of an integer, it follows that one of the equalities $ m^2+5k=(m+1)^2 $ or $ m^2+5k=(m+2)^2 $ must hold. 
If $ m^2+5k=(m+1)^2=m^2+2m+1 $, then $ 2m=5k-1 $ and by the conditions of the problem, the number $ k^2+4m=k^2+2(5k-1)=k^2+10k-2 $ must be a square of an integer. We have $ k^2+10k-2< k^2+10k+25=(k+5)^2 $, so the following relationship holds

from which we obtain $ 2k\leq 18 $ and $ k\le 9 $. Considering the equality $ 2m=5k-1 $, we see that $ k $ must be an odd number. By direct calculation, we check that the values of the expression $ k^2+10k-2 $ for $ k=1 $, $ 3 $, $ 5 $, $ 7 $, $ 9 $ are respectively 9, 37, 73, 117, 169. We obtain squares of integers only for $ k=1 $ and $ k=9 $; the corresponding values of $ m={1\over 2}(5k-1) $ are 2 and 22.
If $ m^2+5k=(m+2)^2=m^2+4m+4 $, then $ 4m=5k-4 $, so the number $ k^2+4m=k^2+5k-4 $ is a square of an integer. The inequality

proves that $ k^2+5k-4\leq (k+2)^2=k^2+4k+4 $, which gives $ k\le 8 $. Moreover, the number $ m={5\over 4}k-1 $ is an integer, so the number $ k $ is divisible by $ 4 $. The expression $ k^2+5k-4 $ for the values $ k=4 $, $ 8 $ takes the values 32, 100 respectively, and only for $ k=8 $ do we obtain a square of an integer; the corresponding value of $ m={5\over 4}k-1 $ is 9.
The case $ m<k $ remains to be considered. In this case, we can write

and since $ k^2+4m $ is a square of an integer, we obtain the relationship $ k^2+4m=(k+1)^2=k^2+2k+1 $, i.e., $ 2k=4m-1 $. However, this equality cannot be true, because its left side is an even number, and the right side is odd. Therefore, there are no solutions in this case.
It is sufficient to verify directly that the three pairs obtained indeed satisfy the conditions of the problem.
LVIII OM - I - Problem 2

Determine all pairs of positive integers $ k $, $ m $, for which each of the numbers $ {k^2+4m} $, $ {m^2+5k} $ is a perfect square.