#K4181. Largest Clique in a Social Network

    ID: 26948 Type: Default 1000ms 256MiB

Largest Clique in a Social Network

Largest Clique in a Social Network

In a social network, a clique is defined as a set of vertices where every pair of distinct vertices is connected by an edge. In other words, if we denote the set as \(S\) and the set of edges as \(E\), then for every two distinct vertices \(i, j \in S\), it must hold that \((i,j) \in E\).

You are given a network of \(N\) vertices numbered from 1 to \(N\) and \(M\) friendship relationships. Each friendship is a bidirectional connection between two vertices. Your task is to compute the size of the largest clique in the network.

Note: You should read input from standard input (stdin) and write output to standard output (stdout).

inputFormat

The input consists of multiple lines:

  • The first line contains two integers \(N\) and \(M\) where \(N\) is the number of vertices and \(M\) is the number of friendships.
  • The next \(M\) lines each contain two integers \(a\) and \(b\), indicating that there is a friendship between vertices \(a\) and \(b\).

outputFormat

Output a single integer representing the size of the largest clique.

## sample
5 4
1 2
2 3
3 4
4 5
2