SP4656 CCROSS - Cross Mountain Climb
Description
Somewhere in the neighborhood we have a very nice mountain that gives a splendid view over the surrounding area. There is one problem though: climbing this mountain is very difficult, because of rather large height differences. To make more people able to climb the mountain and enjoy the view, we would like to make the climb easier. To do so, we will model the mountain as follows: the mountain consists of n adjacent stacks of stones, and each of the stacks is hi high. The successive height differences are therefore h $ _{i+1} $ − h $ _{i} $ (for 1
Input Format
On the first line one positive number: the number of testcases, at most 100. After that per testcase:
- One line with two integers n (2
Output Format
N/A