logo AlgoBeat OnlineJudge
登录 注册

#216523. [GKS 2014 #A] Cut Tiles

内存限制:1024 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Enzo is doing renovation for his new house. The most difficult part is to buy exactly the right number of tiles. He wants tiles of different sizes. Of course they have to be cut from the tiles he bought. All the required tiles are square. The lengths of side of the tiles are , , ..., . He can only buy a lot of tiles sized , and he decides to only cut tiles parallel to their sides for convenience. How many tiles does he need to buy?

输入格式

The first line of the input gives the number of test cases: . lines follow. Each line start with the number and , indicating the number of required tiles and the size of the big tiles Enzo can buy. numbers follow: , , ... , showing the sizes of the required tiles.

输出格式

For each test case, output one line containing "Case #x: y", where is the test case number (starting from 1) and is the number of the big tiles Enzo need to buy.

样例

样例输入 1

4
1 6 2
2 6 2 2
3 6 2 1 1
7 277 3 8 2 6 1 3 6

样例输出 1

Case #1: 1
Case #2: 2
Case #3: 1
Case #4: 2

数据范围与提示

Limits

Small dataset (Test set 1 - Visible)

Large dataset (Test set 2 - Hidden)