**Compilation/Execution Result:**

Given an array of 0 and 1, in how many iterations the whole array be filled with 1's if in a single iteration immediate neighbours of 1's can be filled.

**NOTE: **If you cannot fill array with 1's then print "-1" .

**Input:**

The first line contains a single integer T i.e. the number of test cases. The first line consists of a single integer N(length of array) . The next line consists of a N spaced integers(either 0 or 1).

**Output:**

In one line print the minimum number of iterations to fill the whole string with 1's.

**Constraints:**

1<=T<=100

1<=N<=1000

0<=A[i]<=1

**Examples:**

**Input:**

2

15

1 0 1 0 0 1 0 1 1 0 1 1 0 0 1

17

0 0 1 1 0 0 1 1 0 1 1 1 1 0 0 0 1

**Output:**

1

2

**Explanation:**

**Test Case 1:**

To convert the whole array into 1's, one iteration is required . Between index i=2 and i=5 , the zero at i=3 would be converted to '1' due to its neighbour at i=2 similarly the zero at i=4 would be converted into '1' due to its neighbour at i=5 , all this can be done in a single iteration.

Author: saksham0751

Rajat Thakur 2 | 168 |

surbhi_7 | 164 |

Ibrahim Nash | 132 |

aksh1996aksh | 129 |

D3rek | 128 |

Ibrahim Nash | 646 |

ashrepos | 546 |

RealHorror | 395 |

shi143din | 393 |

shaktiman_shaktiman_shaktiman | 363 |

akhayrutdinov | 4055 |

sanjay05 | 3425 |

Quandray | 2452 |

Michael Riegger | 2230 |

Jasleen Kaur 2 | 2012 |