## Clique

A bunch of people on Facebook would like to find out the largest clique among them.(Maybe this will be the next facebook application?)

A clique is defined as a group of people where everyone is friends with everyone else.

Given a list of friends (friendship works both ways), your job is to output the size of this clique.

For the sake of privacy (and your convenience), we have replaced the names of the people with numbers.

### Input

Number of people, 1 ≤ N ≤ 32Number of friendships, 1 ≤ M ≤ N*(N-1)/2

M lines, each with 2 numbers 1 ≤ a, b ≤ N meaning that a and b are friends.

There will be no duplicate edges.

NOTE: 50% of test cases will have N ≤ 24.

### Output

The size of the maximum clique.### Sample Input

`6 7`

2 3

2 4

2 5

3 4

3 5

4 5

5 6

### Sample Output

4

Friends 2,3,4,5 form the largest clique.

All Submissions

Best Solutions

**Point Value:** 15 (partial)

**Time Limit:** 1.00s

**Memory Limit:** 64M

**Added:** Sep 24, 2008

**Author:** hansonw1

**Problem Types:**[Show]

**Languages Allowed:**

C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

xeonon Apr 03, 2020 - 1:15:58 am UTC Runtime error?Tyroneon Feb 09, 2015 - 12:58:59 am UTC Runtime errorjargonon Feb 09, 2015 - 10:37:49 pm UTC Re: Runtime errorBut... I'm feeling nice today.

Tyroneon Feb 10, 2015 - 2:40:09 am UTC Re: Runtime errorjargonon Feb 10, 2015 - 4:51:40 pm UTC Re: Runtime errorImaxBlueon Nov 13, 2014 - 9:57:26 pm UTC Worthless case???FatalEagleon Nov 13, 2014 - 10:24:12 pm UTC Re: Worthless case???hansonw1on Nov 29, 2008 - 3:35:05 am UTC Hint^{N}combinations of cliques - you can try all of them. (this will give you partial points)You can optimize this, though.

hansonw1on Dec 06, 2008 - 3:29:02 am UTC Hint 2