401490: GYM100482 J Triangles

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Trianglestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Tom has just found out that he can’t make a triangle using three line segments of lengths 1, 2 and 5. He has lots of different line segments and wants to know how many different triangles he can make. The triangles are different if the sets of their line segments’ lengths are different.

Input

The first line contains the number of test cases T (T ≤ 50). The first line of each test case contains the number of segments N (N ≤ 100). The second line of each test case contains N integers ai separated by spaces, ai is the length of i-th line segment (1 ≤ ai ≤ 105).

Output

For each test case output one line containing “Case #tc: num”, where tc is the number of the test case (starting from 1) and num is the number of distinct triangles Tom can make.

ExamplesInput
2
3
2 2 3
5
5 5 5 5 7
Output
Case #1: 1
Case #2: 2

加入题单

算法标签: