Preparing NOJ

# Groups of Navi

1000ms 65536K

## Description:

After measuring the strength of friendships between different Navi, Grace wants to find groups of Navi

who form close-knit friendships. A group of friends has strength k if each Navi in the group has at

least k friends within the group. Your goal is to help Grace find the strongest, largest circle of friends

for individual Navi.

## Input:

Connections between Navi are described beginning with the line “GRAPH BEGIN”. Additional

lines lists individual Navi, followed (on the same line) by their friends. The line ”GRAPH END” ends

the list of connection descriptions. The next lines describe individual Navi to be analyzed, each on a

single line. Following these lines, a completely new instance of the problem can be given, starting from

scratch.

Some Navi may be only be listed as friends of other Navi (i.e., not all Navi will have their connections

listed on a separate line).

## Output:

Connections between Navi are described beginning with the line “GRAPH BEGIN”. Additional

lines lists individual Navi, followed (on the same line) by their friends. The line ”GRAPH END” ends

the list of connection descriptions. The next lines describe individual Navi to be analyzed, each on a

single line. Following these lines, a completely new instance of the problem can be given, starting from

scratch.

Some Navi may be only be listed as friends of other Navi (i.e., not all Navi will have their connections

listed on a separate line).

## Sample Input:

GRAPH BEGINa b cb c d ec d ee d fGRAPH ENDabcdef

## Sample Output:

a 2 a b c d eb 3 b c d ec 3 b c d ed 3 b c d ee 3 b c d ef 1 a b c d e f

## Note:

undefined

Info

Provider NOJ

Code NOJ1392

Tags

Submitted 0

Passed 0

AC Rate 0%

Date 04/20/2019 10:03:10

Related

Nothing Yet