1223 - Friends

Time Limit: 1s Memory Limit: 128MB

Submissions: 37 Solved: 11
Description
Nancy, the leader of a group, always participates in many different kinds of competitions. One day, she decides to choose some of her group members to take part in an important game. In order to win, she has to make sure that each two person chosen could get along well with each other. In this sense, she wants to choose the biggest sub group from this group. And how many people could be contained in the biggest group.
Input
The first line is a number T which refers to the test cases. For each case, the first line is an integer n (0<n<50), which represent the number of person in the group. Then follow n lines, each line contains n intergers,1 or 0.The jth integer in ith line represent the relationship between the ith and the jth person.1 represent they can get well long with each other, otherwise 0. And we will make sure that the jth integer in ith line is the same with the ith integer in jth line. And the ith integer in ith line is 1.
Output
Output the number of biggest sub group. And one line for each case
Sample Input
3
1
1
2
10
01
2
11
11
Sample Output
1
1
2
Hint
Source
Xiangsanzi, HUST Programming Contest 2007