#P12276. Lines through Grid Points in the Traditional Chinese 'Tian' Character

    ID: 14385 Type: Default 1000ms 256MiB

Lines through Grid Points in the Traditional Chinese 'Tian' Character

Lines through Grid Points in the Traditional Chinese 'Tian' Character

In traditional Chinese culture, the character symbolizes a field divided into four equal parts, with a crossing in the center representing paths or water channels. Consider abstracting the character as a grid of 9 points, which are positioned at the four corners, the midpoints of the four sides, and the center of the grid. Mathematically, these points can be considered as arranged in a 3×33\times3 grid (i.e., there are 99 points in total).

Your task is to determine how many distinct straight lines can be drawn that pass through exactly two of these 9 points, and no other grid point. In other words, if a straight line contains three or more of these points, it should not be counted.

Note: Although a pair of points always defines a line, some lines may pass through extra grid points. For example, the horizontal, vertical, and the two main diagonal lines of the grid each pass through three points and should therefore not be counted.

Input Format: There is no input for this problem.
Output Format: Output a single integer representing the number of distinct lines that satisfy the above condition.

inputFormat

There is no input for this problem. You may assume an empty input.

outputFormat

Output a single integer: the number of distinct straight lines that pass through exactly two of the 9 specified grid points.

sample

N/A
12