# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

You have N candles of different lengths. For a candle of length L, you can light it for L minutes. Now there is load shedding in your city but as the exam is knocking, it’s necessary for you to study. You can study if there is any candle which is lit. Answer maximum amount of minutes you can study.

First line contains number of test case **T** (1 ≤ T ≤ 20). Each case starts with **N** (1 ≤ N ≤ 10). The next line has N integers **L _{i}** (1 ≤ L

For each case, output maximum number of minutes you can study.

Input | Output |
---|---|

2 2 1 4 3 1 2 3 | 5 6 |

98% Solution Ratio

sakibalaminEarliest,

sadman12Fastest, 0.0s

TSRaihanLightest, 0 B

mdgaziur001Shortest, 73B

Login to submit

Cybernauts NPC 2018 Ended |

Replay of Cybernauts NPC 2018 Ended |