QOJ.ac

QOJ

时间限制: 1 s 内存限制: 64 MB 总分: 100

#14475. Tip of the Tongue Fang Bo Bo

统计

Uncle Fang on the Tip of the Tongue

To enjoy the most traditional and pure food, Uncle Fang decided to cultivate a vegetable garden himself. There is a plot of land where Uncle Fang has planned $n$ locations to plant vegetables. The freshest vegetables require irrigation from the sweetest well water, so Uncle Fang is going to dig two wells, denoted as well A and well B. Now the question arises: where should the wells be dug? Which well should irrigate each vegetable? Uncle Fang is not good at calculations, so he proposed the following principles and wants to find solutions based on them. The principles are as follows:

  1. A well must be dug at the center of the vegetables it irrigates. That is, if its coordinates are $(X, Y)$, then $X$ ($Y$) is the average of the horizontal (vertical) coordinates of all the vegetables it irrigates.
  2. All vegetables must be irrigated.
  3. Both wells must irrigate at least one vegetable.
  4. Vegetables closer to well A must be irrigated by well A, and vegetables closer to well B must be irrigated by well B. If the distances are equal, they can be irrigated by either well.

Of course, the two wells cannot be dug at the same location, and multiple vegetables will not be planted at the same location. Uncle Fang has told you his cultivation principles; please tell him how many solutions satisfy these principles. We denote the well that irrigates vegetable 1 as well A. Then, as long as the set of vegetables irrigated by A is different, it is considered a different solution.

Input

The first line contains one integer $n$, representing the number of vegetables Uncle Fang has. The next $n$ lines each contain two integers $x_i, y_i$, representing the coordinates of the $i$-th vegetable.

Output

Output one integer, representing the number of feasible solutions for Uncle Fang.

Examples

Input 1

3
3 4
1 1
5 1

Output 1

3

Constraints

For 30% of the data, $1 \le n \le 20$. For 50% of the data, $1 \le n \le 40$. For 100% of the data, $1 \le n \le 60$, $0 \le x_i, y_i \le 60$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.