{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\n\u003cp style\u003d\"text-align: justify;\"\u003e There is an in\u0026#x1c;nite grid on the plane consisting of vertical and horizontal lines. The lines are given by equations {\u003cstrong\u003eX\u003c/strong\u003e \u003d \u003cstrong\u003ei\u003c/strong\u003e·\u003cstrong\u003eK\u003c/strong\u003e} and {\u003cstrong\u003eY\u003c/strong\u003e \u003d \u003cstrong\u003ej\u003c/strong\u003e·\u003cstrong\u003eK\u003c/strong\u003e} for any integers \u003cstrong\u003ei\u003c/strong\u003e and \u003cstrong\u003ej\u003c/strong\u003e. Also, a set of \u003cstrong\u003eN\u003c/strong\u003e points is given. We say that a point lies on the grid if it lies on at least one of the lines which form the grid.\u003c/p\u003e\n\u003cp style\u003d\"text-align: justify;\"\u003e The grid may be moved parallel to the coordinate axes. Translation of the grid by vector (\u003cstrong\u003edx\u003c/strong\u003e, \u003cstrong\u003edy\u003c/strong\u003e) means that each line {\u003cstrong\u003eX\u003c/strong\u003e \u003d \u003cstrong\u003ei\u003c/strong\u003e·\u003cstrong\u003eK\u003c/strong\u003e} is replaced by line {\u003cstrong\u003eX\u003c/strong\u003e \u003d \u003cstrong\u003ei\u003c/strong\u003e·\u003cstrong\u003eK\u003c/strong\u003e + \u003cstrong\u003edy\u003c/strong\u003e}, and each line {\u003cstrong\u003eY\u003c/strong\u003e \u003d \u003cstrong\u003ej\u003c/strong\u003e·\u003cstrong\u003eK\u003c/strong\u003e} is replaced by line {\u003cstrong\u003eY\u003c/strong\u003e \u003d \u003cstrong\u003ej·K + dx\u003c/strong\u003e}. Find the maximum possible number of points from the given set which can simultaneously lie on the grid after its translation by some vector.\u003c/p\u003e\n\u003cp style\u003d\"text-align: justify;\"\u003e\u003cstrong\u003eInput\u003c/strong\u003e\u003c/p\u003e\n\u003cp style\u003d\"text-align: justify;\"\u003e The fi\u0026#x1c;rst line of input contains two integers \u003cstrong\u003eN\u003c/strong\u003e and \u003cstrong\u003eK\u003c/strong\u003e. The \u003cstrong\u003ei\u003c/strong\u003e-th of the next \u003cstrong\u003eN\u003c/strong\u003e lines contains numbers \u003cstrong\u003eX\u003csub\u003ei\u003c/sub\u003e\u003c/strong\u003e, \u003cstrong\u003eY\u003csub\u003ei\u003c/sub\u003e\u003c/strong\u003e — the coordinates of the \u003cstrong\u003ei\u003c/strong\u003e-th point (\u003cstrong\u003e1\u003c/strong\u003e ≤ \u003cstrong\u003eN\u003c/strong\u003e ≤ \u003cstrong\u003e10\u003csup\u003e5\u003c/sup\u003e\u003c/strong\u003e, \u003cstrong\u003e2\u003c/strong\u003e ≤ \u003cstrong\u003eK\u003c/strong\u003e ≤ \u003cstrong\u003e10\u003csup\u003e9\u003c/sup\u003e\u003c/strong\u003e). The points\u0027 coordinates are integers and do not exceed \u003cstrong\u003e10\u003csup\u003e9\u003c/sup\u003e\u003c/strong\u003e by absolute value. No two points coincide.\u003c/p\u003e\n\u003cp style\u003d\"text-align: justify;\"\u003e\u003cstrong\u003eOutput\u003c/strong\u003e\u003c/p\u003e\n\u003cp style\u003d\"text-align: justify;\"\u003e Output the maximal possible number of points from the given set which can simultaneously lie on the grid.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre class\u003d\"eo-code\" id\u003d\"example-input-1\"\u003e6 2\n2 0\n0 1\n2 2\n3 3\n3 2\n4 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre class\u003d\"eo-code\" id\u003d\"example-output-1\"\u003e5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}