P19483 [HackerEarth] One day, Penny gave Sheldon a task to solve some problems for her. Since Sheldon does not like to reject the challenges given to him, he cheerfully accepted the task he needs to perform.
普及
题目描述

One day, Penny gave Sheldon a task to solve some problems for her. Since Sheldon does not like to reject the challenges given to him, he cheerfully accepted the task he needs to perform. Now the task is he first needs to solve first solve problem 0. After solving each problem i, he must either move onto problem i+1 or skip ahead to i+2 that means he is not allowed to skip more than one problem.

Now given a int[] array, where array[i] indicates how much he likes problem i. Penny will let him stop solving problems once the range of pleasantness he has encountered reaches a certain threshold. Specifically, Sheldon may stop solving problems once the difference between the maximum and minimum pleasantness of the problems he has solved is greater than or equals to the threshold or limit. If this does not happen, he has to solve all the problems. Your task is to calculate the minimum number of problems that Sheldon must solve to fulfill the task given to him by Penny.

Input:
The first line of the input contains an integer T the number of test cases. Then T test cases follow. Each test case consists of a line which contains a positive integer, n. Next line contains n space separated numbers- the elements of the array[]. Next line contains an integer threshold/limit.

Output:
Output the minimum number of problems that Sheldon has to solve.
Constrains:
1 ≤ T ≤ 100
1 ≤ n ≤ 50
arrar[0],arrar[1] ..,array[i],..array[n-1] ≤1000

SAMPLE INPUT
1
3
1 2 3
2

SAMPLE OUTPUT
2

输入格式

见题面

输出格式

见题面

样例输入
11 50 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 23 209 226 161 127 61 169 172 59 46 42 58 137 84 73 193 104 24 34 192 123 72 69 27 121 50 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 50 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 49 9 6 2 6 2 6 3 3 3 7 10 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 1 9 10 10 6 5 10 10 14 16 18 8 7 5 8 8 5 5 5 2 6 39 221 11 153 318 78 157 113 264 361 143 11 192 89 134 146 281 107 127 225 88 236 4 133 144 266 363 127 22 336 286 240 180 302 321 247 314 112 180 239 270 41 94 41 231 245 229 169 84 336 109 342 99 94 90 174 162 322 214 251 126 145 86 89 80 219 179 95 162 221 11 353 172 384 53 193 408 389 106 108 30 61 249 305 49 270 479 223 160 455 458 278 403 269 169 350 246 180 317 316 488 274 207 144 278 284 39 319 234 120 388 200 5 165 121 120 154 470 238 487 337 101 70 130 203 441 465 413 451 87 169 48 51 123 386
样例输出
50 3 50 26 9 50 4 4 3 16 12