Count how many points in a set have at least one point strictly above, below, to the left, and to the right of them.
You are given points on a 2D plane. A point is called supercentral if there exists at least one other point:
In other words, a supercentral point must have at least one point in each of the four cardinal directions: up, down, left, and right.
Your task is to determine how many points are supercentral.
Print a single integer — the number of supercentral points.
Example 1
Input
8 0 0 1 0 -1 0 0 1 0 -1 2 2 2 1 2 3
Output
1
Explanation
Only point has a point to the left, right, above, and below it.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.