You are given a sequence of integers a1,a2,a3,…,an. An island is a contiguous block of the sequence in which every element is greater than the element immediately before the block and greater than the element immediately after it. A block with no element before it, or no element after it, is not an island.
An island that lies entirely inside another island still counts as its own island, so each one adds 1 to the total.
You are given a sequence of 15 non-negative integers in which each integer differs from the previous integer by at most 1. Write a program that counts the islands in the sequence.
The first line contains the number of data sets P (1≤P≤1000). The data sets are independent and are all processed the same way.
Each of the next P lines holds one data set. The line begins with the data set number K, followed by 15 non-negative integers separated by single spaces. The first and the last of those 15 integers are 0. Each integer differs from the previous integer by at most 1.
Print one line for each data set. The line consists of the data set number K, a single space, and the number of islands in that sequence.