Datasets:

Modalities:
Image
Text
Formats:
parquet
Size:
< 1K
Tags:
code
Libraries:
Datasets
pandas
License:
File size: 1,222 Bytes
c623d8c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"Happy birthday to you... Happy birthday to you... Happy birthday to
Grovyle... Happy birthday to you..."

Today is Grovyle's birthday and he is going to invite his friends to his
birthday party. To have an awesome party, each of the attendants should get
one piece of cake. Your job is to help Grovyle invite as many friends as you
can.

However, Grovyle's parents are very mean, and make him use the following rules
when cutting his cake:

* There is only ONE cylindrical cake. 
* Grovyle cuts the cake **N** times, each cut being perpendicular to the surface of the cake. 
* The **i**-th cut is a broken line with **a**[**i**] vertices. 
* The knife is only allowed to intersect the edge of the cylindrical cake at the start and end of the cut. 

What is the maximum number of pieces Grovyle could get?

### Input

The first line contains an integer **T**, **T** ≤ 50, indicating the number of
test cases. Each test case begins with an integer **N**, 1 ≤ **N** ≤ 100,
followed by **N** integers **a**[**i**], 0 ≤ **a**[**i**] < 400, which
indicate the number of vertices in the **i**-th cut.

### Output

For each test case, output "Case #i: " followed by the maximum number of
pieces of cake Grovyle can cut.