You are given an array** A** representing size of candles which **reduce 1 unit in a day**. Room is illuminated using given** x** candles, where x is the size of array A. Question is to find maximum number of days room is without darkness.

**Input:**

The first line of input consists of an integer** T** denoting the number of test cases. T testcases follow. Each test case contains an integer **N** denoting the size of the array. Then in the next line are **N** space separated elements of the array.

**Output:**

For each test case, print the maximum number of days room will be illuminated.

**Constraints:**

1<=T<=200

1<=N<=10^{7}

1<=Elements of array <=10^{18}

**Example:**

**Input:**

2

3

1 1 2

5

2 3 4 1 2

**Output:**

2

4

**Explanation:
Testcase1: **The candles' length reduce by 1 in 1 day.

So, at the end of day 1: Sizes would be 0 0 1

So, at end of day 2: Sizes would be 0 0 0.

This means the room was illuminated for 2 days.

Author: Ayush jha

BadiMehnatLagtiHaiEasySawalMe | 480 |

Jihye Sofia Seo | 187 |

RohitBattu | 176 |

MaaChudaApniBadiMehnatLagtiHaiEasySawal | 173 |

piyushmittal25 | 172 |

AdityaSharma16 | 490 |

BadiMehnatLagtiHaiEasySawalMe | 480 |

saumitra13325 | 452 |

blackshadows | 430 |

ashujack | 401 |

blackshadows | 5188 |

akhayrutdinov | 5099 |

Ibrahim Nash | 5071 |

Quandray | 4354 |

sanjay05 | 3668 |

Login to report an issue on this page.