(In reply to
Solution by Gamer)
So, what you are saying is that n comes in two possible flavors -- even or odd.
If n is even, choose k such that k=(n-2)/2; choose i such that i=(n-4)/2; and choose j such that j=n-1.
If n is odd, choose k, i, and j such that k=(n-1)/2; i=(n+1)/2; and once again, j=n-1.
Good job! When I first looked at this problem, it seemed daunting. But your solution made it clear to me. Thanks.