URI Online Judge | 1784
# Birds vs Crows

**Timelimit: 1**

By Gustavo Stor, UFPE Brazil

There are N birds in a forest, each in their respective tree. There are N tired crows in this forest, and they wish to land in different trees as soon as possible (crows are extremely quarrelsome and they can't share the same tree). Every P_{i} minutes, the i-th bird leaves the tree to fly a little bit, and you can consider that it returns immediately. Every C_{i} minutes, the i-th crow can try to land in a tree which there's no bird or can just keep flying. You can consider that crows are faster than birds and if the bird leaves the tree at the same minute that a crow tries to land in it, the crow will land faster. Given an optimal strategy between the crows, what is the earliest time in which every crow will be relaxing, each one in a different tree?

The first line contains an integer **T** (1 ≤ **T **≤ 100), the number of test cases. Each test case starts with an integer **N** (1 ≤ **N **≤ 9), the number of birds and crows. The second line contains **N** integers **P**_{i} (1 ≤ **P _{i} **≤ 10⁴), as described in the problem statement. The third and last line of each test case contains

For each test case print “Caso #**X**: **Y**”, where **X** is the number of the current case, starting at 1, and **Y** is the answer to the problem.

Input Sample | Output Sample |

2 |
Caso #1: 6 |