Computer Science, asked by therayofsunkirp2p30b, 7 months ago

The given is the state with 3*3 cities and their dominance representation.
City[1, 1] is directly connected to City[1, 2].
City[1, 2] is directly connected to City[1, 1], City[1, 3] and City[2, 3].
City[1, 3] is directly connected to City[1, 2] and City[2, 3].
City[2, 3] is directly connected to City[1, 2] and City[1, 3].
City[3, 1] is not connected to any of the other coder dominant cities.
One or more coder dominant connected cities form the Coding belt. In a belt, there may be coder dominant cities which are not directly connected but can be reached by moving through other dominant cities. It is possible that there are multiple coding belts in the state.

Example:
The given is the state with 3*3 cities and their dominance representation.
For the given example, there are two coding belts. C1 represents Coding Belt 1 and C2 represents Coding Belt 2.
The government wants to find the number of coder dominant cities in the largest coding belt.
The government will give you the credits in the initiative. Can you help the government?

Note: For the given example, there are 4 coder dominant cities in the largest coding belt.
Input Format
The first line of input consists of two space-separated integers, number of rows, R, and number of columns, C.
Next R lines each consist of C space-separated integers.
Constraints
1<= R, C <=10
Output Format
Print the number of coder dominant cities in the largest Coding belt.
Sample TestCase 1
Input
5 51 1 1 0 00 1 1 0 00 0 0 0 11 0 0 1 11 1 0 0 1
Output
5
Explanation
There are three belts in the given 5*5 cities.
Coding Belt 1 (C1): Number of Coder Dominant Cities = 5
Coding Belt 2 (C2): Number of Coder Dominant Cities = 4
Coding Belt 3 (C3): Number of Coder Dominant Cities = 3

Answers

Answered by dollyjain872
0

Answer:

Nhx jv c jv b jv luv luv ihg x x 'c oh oh u c oc u yg y

Explanation:

Gc v u hv boh u tf x x f npuc chc vvb lugx u v

Similar questions