{"problem":{"name":"+3 +5 +7","description":{"content":"You are given integers $x_1$, $x_2$, and $x_3$. For these integers, you can perform the following operation any number of times, possibly zero. *   Choose a permutation $(i,j,k)$ of $(1,2,3)$, that i","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc158_a"},"statements":[{"statement_type":"Markdown","content":"You are given integers $x_1$, $x_2$, and $x_3$. For these integers, you can perform the following operation any number of times, possibly zero.\n\n*   Choose a permutation $(i,j,k)$ of $(1,2,3)$, that is, a triple of integers $(i,j,k)$ such that $1\\leq i,j,k\\leq 3$ and $i\\neq j, i\\neq k, j\\neq k$.\n*   Then, simultaneously replace $x_i$ with $x_i+3$, $x_j$ with $x_j+5$, and $x_k$ with $x_k+7$.\n\nYour objective is to satisfy $x_1=x_2=x_3$. Determine whether it is achievable. If it is, print the minimum number of times you need to perform the operation to achieve it.\nYou have $T$ test cases to solve.\n\n## Constraints\n\n*   $1\\leq T\\leq 2\\times 10^5$\n*   $1\\leq x_1, x_2, x_3 \\leq 10^9$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\vdots$\n$\\text{case}_T$\n\nEach test case is in the following format:\n\n$x_1$ $x_2$ $x_3$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc158_a","tags":[],"sample_group":[["4\n2 8 8\n1 1 1\n5 5 10\n10 100 1000","2\n0\n-1\n315\n\nFor the first test case, you can do the following to satisfy $x_1=x_2=x_3$.\n\n*   Perform the operation with $(i,j,k) = (3,2,1)$, replacing $(x_1,x_2,x_3)$ with $(9,13,11)$.\n*   Perform the operation with $(i,j,k) = (2,3,1)$, replacing $(x_1,x_2,x_3)$ with $(16,16,16)$."]],"created_at":"2026-03-03 11:01:14"}}