---
{"category_name":"easy","problem_code":"POINTMEE","problem_name":"2-D Point Meeting","problemComponents":{"constraints":"- $1 \\leq T \\leq 300$\n- $2 \\leq N \\leq 100$\n- $-10^9 \\leq X_i, Y_i \\leq 10^9$\n- $(X_i, Y_i) \\neq (X_j, Y_j)$ if $(i \\neq j)$\n- Sum of $N$ over all test cases does not exceed $600$.","constraintsState":true,"subtasks":"**Subtask #1 (100 points):** original constraints\n","subtasksState":true,"inputFormat":"- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.\n- Each test case contains three lines of input.\n- The first line contains a single integer $N$.\n- The second line contains $N$ space-separated integers $X_1, X_2, \\ldots, X_N$.\n- The third line contains $N$ space-separated integers $Y_1, Y_2, \\ldots, Y_N$.","inputFormatState":true,"outputFormat":"For each test case, print a single line containing one integer - the minimum number of operations to achieve the goal.","outputFormatState":true,"sampleTestCases":{"0":{"id":1,"input":"2\n3\n0 1 -4\n0 1 5\n3\n0 1 3\n1 1 -1\n\n","output":"3\n2\n","explanation":"**Test case $1$** : \n- In the first operation, you choose $i = 2$, and $K = - 1$ and apply the third type of operation. So the location of $2^{nd}$ point becomes $(1 - 1, 1 - 1) = (0, 0)$.\n\n- In the second operation, you choose $i = 3$, and $K = 4$ and apply the first type of operation. So the location of $3^{rd}$ point becomes $(- 4 + 4, 5) = (0, 5)$.\n\n- In the third operation, you choose $i = 3$, and $K = -5$ and apply the second type of operation. So the location of $3^{rd}$ point becomes $(0, 5 - 5) = (0, 0)$.\n\nHence after the above operations, the location of the given three points becomes equal to each other.\n\n**Test case $2$** : \n- In the first operation, you choose $i = 1$ and $K = 1$ and apply the first type of operation. So the location of 1st point becomes $(0 + 1, 1) = (1, 1)$.\n\n- In the second operation, you choose $i = 3$, and $K = -2$ and apply the fourth type of operation. So the location of 3rd point becomes $(3 - 2, -1 - (-2)) = (1, 1)$.\n\nHence after the above operations, the location of the given three points becomes equal to each other.","isDeleted":false}}},"video_editorial_url":"","languages_supported":{"0":"CPP14","1":"C","2":"JAVA","3":"PYTH 3.6","4":"CPP17","5":"PYTH","6":"PYP3","7":"CS2","8":"ADA","9":"PYPY","10":"TEXT","11":"PAS fpc","12":"NODEJS","13":"RUBY","14":"PHP","15":"GO","16":"HASK","17":"TCL","18":"PERL","19":"SCALA","20":"LUA","21":"kotlin","22":"BASH","23":"JS","24":"LISP sbcl","25":"rust","26":"PAS gpc","27":"BF","28":"CLOJ","29":"R","30":"D","31":"CAML","32":"FORT","33":"ASM","34":"swift","35":"FS","36":"WSPC","37":"LISP clisp","38":"SQL","39":"SCM guile","40":"PERL6","41":"ERL","42":"CLPS","43":"ICK","44":"NICE","45":"PRLG","46":"ICON","47":"COB","48":"SCM chicken","49":"PIKE","50":"SCM qobi","51":"ST","52":"SQLQ","53":"NEM"},"max_timelimit":1,"source_sizelimit":50000,"problem_author":"soumyadeep_21","problem_tester":"","date_added":"30-08-2021","tags":{"0":"easy","1":"math","2":"sept21","3":"soumyadeep_21"},"problem_difficulty_level":"Unavailable","best_tag":"","editorial_url":"https://discuss.codechef.com/problems/POINTMEE","time":{"view_start_date":1631525400,"submit_start_date":1631525400,"visible_start_date":1631525400,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=POINTMEE","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
### Read problem statements in [Bengali](https://www.codechef.com/download/translated/SEPT21/bengali/POINTMEE.pdf), [Mandarin Chinese](https://www.codechef.com/download/translated/SEPT21/mandarin/POINTMEE.pdf), [Russian](https://www.codechef.com/download/translated/SEPT21/russian/POINTMEE.pdf), and [Vietnamese](https://www.codechef.com/download/translated/SEPT21/vietnamese/POINTMEE.pdf) as well.
You are given $N$ *distinct* points in a $2$-D plane, numbered $1$ through $N$. The X-coordinate of the points are $X_1, X_2, \ldots, X_N$ respectively and the Y-coordinates are $Y_1, Y_2, \ldots, Y_N$ respectively. Your goal is to make the location of all the $N$ points equal to that of each other. To achieve this, you can do some operations.
In one operation, you choose an index $i\;(1 \leq i \leq N)$ and a **real number** $K$ and change the location of the $i^{th}$ point in one of the following ways:
- Set $(X_i, Y_i) = (X_i + K, Y_i)$
- Set $(X_i, Y_i) = (X_i, Y_i + K)$
- Set $(X_i, Y_i) = (X_i + K, Y_i + K)$
- Set $(X_i, Y_i) = (X_i + K, Y_i - K)$
Find the minimum number of operations to achieve the goal.
<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>