I came up with the following problem:
Given an array $$$A$$$ of $$$N$$$ non-negative integers, output $$$2$$$ permutations $$$X$$$ and $$$Y$$$ such that $$$|X_i - Y_i| \le A_i$$$ for all $$$(1 \le i \le N)$$$ or report that it is impossible to do so.
For example, given this test case:
$$$N = 5$$$
$$$A = [2,2,4,2,2]$$$
The output could be:
$$$X = [5,2,1,3,4]$$$
$$$Y = [3,4,5,1,2]$$$
I have not given constraints on $$$N$$$ as I am not sure what the best possible time complexity of a solution to this problem is.