YJC counts stars

Time Limit: 2000/1000 MS (Java/Others)

Memory Limit: 524288/262144 K (Java/Others)

Description

YJC is an old driver of mini train. One night he looked up to the sky and realised that the sky can be abstracted as a plane G and the stars can be abstracted as some points in the plane.
He labeled the points from $1$ to $n$. Also, he couldn't find a line crossing three points. YJC connected some points with some segments. But he made sure the segments wouldn't cross each other. YJC is extremely interested in some subsets of the points in which every two points are connected. He wants to find the subsets with maximum points and count them.

Input

Multiple tests.

For each test:

The first line lie two integers $n,m$,indicating the number of points and the number of segments in G.
The next $n$ lines each line lie two integers $x,y$, indicating the coordinates of the $i$th point.
The next $m$ lines each line lie two integers $u,v$, indicating an segment (u,v).

Output

For each test:

Two integers sz and sum, representing the number of the maximum points and the number of the maximum subsets.

Sample Input

2 1 1 1 2 2 1 2 3 3 1 1 2 2 4 5 1 2 2 3 3 1

Sample Output

2 1 3 1
Hint
$1 \leq n \leq 1000$ $1 \leq T \leq 5$(T represents the number of testcases) It is guaranteed that no two edges or points are exactly the same and $u \neq v$. $-1e9 \leq x,y \leq 1e9$

Hint

hujie

Source

BestCoder Round #46

提交代码