logo AlgoBeat OnlineJudge
登录 注册

#216220. [ICPC 2016 NAIPC] Symmetry

内存限制:512 MiB 时间限制:5000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

You are totally bored with nothing to do. You notice a pattern of spots on the wall in front of you and begin to dwell on them. There is no obvious pattern of symmetry. With time this becomes very grating, and you contemplate adding more spots to satisfy your quest for balance. For this exercise you are to resolve this situation with a computer program.

:::align{center} :::

Given an array of spots with coordinates in the range from to , determine the fewest additional spots needed to generate a pattern with some symmetry. The symmetry can be around a point or across a line. If the symmetry is around a point, the point does not need to be a spot in the data, or even a point with integral coordinates. If the symmetry is across a line, the line may be at any angle. The coordinates of the additional spots may or may not be within the to limits.

输入格式

Each input will consist of a single test case. Note that your program may be run multiple times on different inputs. The first line of input will consist of a single integer () indicating the number of spots. Each of the next lines will hold two space-separated integers and (), which are the coordinates of a spot. The locations of all spots are guaranteed to be unique.

输出格式

Output a single integer, indicating the smallest number of spots which need to be added so that all of the spots are symmetric about some point, or about some line.

样例

样例输入 1

4
0 0
1000 0
0 1000
1000 1000

样例输出 1

0

样例输入 2

11
0 0
70 100
24 200
30 300
480 400
0 100
0 200
0 400
100 0
300 0
400 0

样例输出 2

6