Given $$$3$$$ integers $$$x$$$, $$$y$$$, and $$$z$$$, you can perform three types of operations on them.
Swap the values of any $$$2$$$ of them ($$$x$$$ and $$$y$$$ or $$$x$$$ and $$$z$$$ or $$$y$$$ and $$$z$$$).
Choose one of them and increase the value of it by $$$1$$$
Choose one of them that is greater than $$$1$$$ and decrease the value of it by $$$1$$$.
Whats the minimum number of operations to make $$$x$$$ a factor of both $$$y$$$ and $$$z$$$?
On the first line there will be the number of tests $$$t$$$ – ($$$1 \le t \le 100$$$).
On the first line of each test case there will be the $$$x$$$, $$$y$$$, and $$$z$$$ – ($$$1 \le x, y, z \le 10^4$$$).
The answer for each test case will be a single integer on a single line.
410 25 3510 9 111 10 203 2 1
4 2 0 1
In the first test case, we can decrease $$$x$$$ by $$$1$$$, increase $$$y$$$ by $$$2$$$, and increase $$$z$$$ by $$$1$$$.