We’re preparing your current view and syncing the latest data.
You are given a graph consisting of n vertices and m edges. Each edge is undirected. The problem involves determining properties of the graph related to paths and vertex orderings that satisfy certain conditions. Specifically, the 'intriguing obsession' relates to establishing a certain configuration or maximal structure within the graph, which can be formulated as finding a special subset or maximum structure according to given constraints. The objective is to output the size of the largest such configuration. The exact problem involves managing components and ordering vertices to maximize or verify the structure's properties.
The first line contains two integers n and m — the number of vertices and the number of edges. The following m lines each contain two integers u and v, describing an edge between vertices u and v.
Output a single integer — the size of the largest configuration satisfying the problem's conditions.
1 ≤ n ≤ 3000; 0 ≤ m ≤ min((n(n-1))/2, 3000); 1 ≤ u, v ≤ n; no multiple edges or self-loops.
Example 1
Input
5 5 1 2 2 3 3 4 4 5 1 5
Output
3
Explanation
In this example, the largest configuration satisfying the problem conditions corresponds to a component or path of length 3.