Amit has come to the Universal Parking Space. He has to go on an inter-galaxy trip and needs to park his car here. The parking lot is made of many unit-spaced parallel lines numbered integers 1 to M. Amit must park his car such that the center of his car passes one of these lines. Amit's car is SIZE units wide, thus even though his center part lies on one line, the car as a whole may be passing over many lines.
He must also ensure that any part of his car does not touch either of the edge lines of the parking lot, i.e., the lines 1 and M (they have very high electromagnetic discharge).
Now, in his galaxy all the cars need to be fitted with radiation withstanding shields as Radiation Missiles can be dropped by the AlphaCentauri invaders anytime. These Radiation Missiles land at one point and spread upto a particular range in exactly one direction(left or right) before it bursts into flames. Bob must also ensure that his car does not touch any of the end points, i.e., where the missile lands and where the missile bursts. However, if his car happens to be between these end points, then it will still be safe if not more than K missile radiations pass through it.
Can you tell Bob the number of lines on which he can safely park his car such that the it is not harmed?
First line consists of 1 integer T indicating the number of test cases.
First line of each test case contains 4 integers N, M, SIZE and K where :
For each test case, output the number of possible points where he can park the car without suffering any damage.
Case 1:
He cannot park at line 1 and 5(edge points).
The rocket lands at line 5 and bursts at line 1(4 units to left). Hence again these 2 lines are out of bounds.
If he parks at line 2, the left half of the car will touch the line 1(edge point). Hence not allowed.
He can safely park at line 3 as his car can withstand 1 radiation missile.
If he parks at line 4, the right half of the car will touch the line 5(edge point). Hence not allowed.
Hence there are two available parking lines in this case.
Case 2:
He cannot park at line 1 and 4(edge points).
If he parks at line 2, the left half of the car will pass the line 1(edge point).
If he parks at line 3, the right half of the car will pass the line 4(edge point).
Hence there is no available parking line in this case.
Case 3:
The 3 lines are 2, 4 and 8.