Easy Beginners Problems > Ad-hoc

**Black cat** are very special and have much more power. **Bittu** is not a black cat, so it has limited power. it has jumping power **P**,which means that it can jump forward to **at most P** distance. ![enter image description here][1] Now, **Bittu** is facing difficulty in crossing river of width **R**. There are some stones at certain distances from left side of the river. But some stones are separated by very longer distance that Bittu can not jump over it using its jumping power. If the distance to the next stone is found to be **X**, then Bittu needs at least **X** jumping power to be able to jump over and go there.<br> You are given the distances of stones from the left side of the river. Your task is to determine least amount of jumping power Bittu needs to increase so that it can goes to right side of the river. Input: ------ Input starts with an integer **T (1<=T<=20)**, denoting the number of test cases. Each test cases starts with three space separated integers **N (0<=N<=100)** , **R(1<=R<=10^9)** and **P (1<=P<=10^9)**, denoting total stones in the river, width of the river and initial jumping power of Bittu respectively (You may safely assume that left side of the river, stone placement and right side of the river forms a straight line).Then there will be N space separated integers **X (1<=X<=R-1)** denoting distance of stone from the left side of the river.( Distances are given arbitrary and there may be two stones at the same distance ) Output: ------- For each case of input, output an integer denoting total jumping power Bittu needs to increase in order to be able to go right side of the river. Sample Input ------------ 1 2 10 4 5 8 Sample Output ------------- 1 **Explanation of sample:**<br> Bittu needs jumping power of at least 5 to reach first stone. After that it needs jumping power of at least 3 to reach another stone. Then, it needs jumping power at least 2 to reach right side of the river. As it has jumping power of 4 already. So, If it increases current jumping power by 1, then it could reach the right side of the river easily. [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/38a5c9ff-757b-c0b0-539f-08d558d34f05_02d3c2b6ebe346c3abeed6dd626b4651_W170xH113.jpg

Bishal Gautam