18.7. (CSSR, 63). For each value of $k \in \mathbf{N}$, represent the number $2 k$ as the sum of two coprime numbers $x$ and $y$ such that the product $x y$ is the largest possible.
18.7. Without loss of generality, we can assume that $x \geqslant y$. Let $p=x-k$. Then $x=k+p, y=2 k-x=k-p, p \geqslant 0$, and the product

$$
x y=(k+p)(k-p)=k^{2}-p^{2}
$$

attains its maximum value at the smallest possible value of $p$. Let $p=0$, then $x=y=k$ and the numbers $x, y$ are coprime only when $k=1$. Let $p=1$, then $x=k+1, y=k-1$. For the numbers $x, y$ to be coprime, it is necessary for the number $k$ to be even (otherwise both numbers $x$ and $y$ would be divisible by 2). However, this condition is also sufficient, since the common divisors of the numbers $x$ and $y$ can only be the divisors of their difference $x-y=(k+1)-(k-1)=2$ (i.e., the numbers 1 or 2), and at an even value of $k$, the number 2 is not a divisor, for example, of the number $x=k+1$. Let $p=2$, then the numbers $x=k+2, y=k-2$ are coprime for an odd value of $k$, since in this case the numbers $x, y$ are odd and cannot have common divisors other than the divisors of their difference $x-y=(k+2)-(k-2)=4$. Thus, the required numbers $x, y$ are determined as follows:

if $k=1$, then $x=1, y=1$;

if $k=2 m, m \in \mathrm{N}$, then $x=k \pm 1, y=k \mp 1$;

if $k=2 m+1, m \in \mathbf{N}$, then $x=k \pm 2, y=k \mp 2$.