# Alien Invasion SOLUTIONS ALIENIN

Page Contents

### Alien Invasion SOLUTIONS ALIENIN

Culinary expert is the pioneer of Chef’s Earth Defense Organization, and his crucial to counter outsiders which are undermining the earth. As per data accumulated by the association, there are N outsider spaceships (numbered 1 through N) intending to attack the earth. The I-th spaceship will show up on the radar at time Ci. Every spaceship needs D time to arrive at earth once it shows up on the radar.

Cook’s association claims an enormous laser gun which can demolish one spaceship in one shot. In any case, when the gun is utilized once it needs some measure of chill off time so as to be utilized once more (first shot doesn’t need chill off time before it is utilized). This chill off time, notwithstanding, is configurable. It must be set before the primary shot, and can’t be changed after that. In the event that Chef sets a let chill off time, that would build the vitality devoured by the gun, and the other way around – the higher the chill off time, the lower the vitality expended.

This may be a long fight, and Chef needs to use as meager vitality as could reasonably be expected. So Chef needs to boost the chill off time while as yet having the option to annihilate all spaceships before any of them show up on earth. Specifically, the I-th spaceship ought to be shot between the occasions Ci and Ci+D (both end focuses comprehensive).

Information:

The primary line of information contains a solitary whole number T indicating the quantity of experiments. The portrayal of T experiments follows.

The primary line of each experiment contains two numbers N and D.

The subsequent line contains N space-isolated numbers C1,C2,… ,CN.

Yield:

For each experiment, print a solitary line containing one genuine number― the greatest chill off time conceivable. Your answer will be viewed as right if the outright or relative blunder of the appropriate response doesn’t surpass 10−6.

Limitations

1≤T≤1000

2≤N≤105

1≤Ci≤109 for each legitimate I

1≤D≤109

The total of N over all experiments doesn’t surpass 106

N≤1,000

the total of N over all experiments doesn’t surpass 10,000

Subtask #2 (50 focuses): Original limitations

Test Input:

3 2

3 2 3

2 1

5 6

Test Output:

1.5000000000

2.0000000000