#P16751. [GKS 2020 #B] Bike Tour

[GKS 2020 #B] Bike Tour

Problem Description

Li has planned a bike tour through the mountains of Switzerland. His tour consists of NN checkpoints, numbered from 1 to NN in the order he will visit them. The ii-th checkpoint has a height of HiH_i.

A checkpoint is a peak if:

  • It is not the 1st checkpoint or the NN-th checkpoint, and
  • The height of the checkpoint is strictly greater than the checkpoint immediately before it and the checkpoint immediately after it.

Please help Li find out the number of peaks.

Input Format

The first line of the input gives the number of test cases, TT. TT test cases follow. Each test case begins with a line containing the integer NN. The second line contains NN integers. The ii-th integer is HiH_i.

Output Format

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the number of peaks in Li's bike tour.

4
3
10 20 14
4
7 7 7 7
5
10 90 20 90 10
3
10 3 10
Case #1: 1
Case #2: 0
Case #3: 2
Case #4: 0

Hint

  • In sample case #1, the 2nd checkpoint is a peak.
  • In sample case #2, there are no peaks.
  • In sample case #3, the 2nd and 4th checkpoint are peaks.
  • In sample case #4, there are no peaks.

Limits

1T1001 \le T \le 100.

1Hi1001 \le H_i \le 100.

Test Set 1

3N53 \le N \le 5.

Test Set 2

3N1003 \le N \le 100.