13228 - Unlimited Triangle Work - ver2   

Description

After obtaining enough swords, Gilgamesh would like to forge some more swords in his favorite form.

The requirements of forging a sword is to build a valid triangle: . However, Gilgamesh prefers swords that forged by one more constrain: .

Now, he threats you with more swords that you forged, you have to help him.


You are given for positive integer , you're going to count how many eligible triangles can be build by edges with length , where .

A eligible triangle should follow the following condition:

For example:

You can build triangles with edges:

So the answer is 3.

  • Note that although is a valid triangle, it does not fit the 2-nd constrain: ().

Input

The first line contains one integer , there are testcases below.

For each testcase, the four integer is given respectively.

.

.

Output

For each testcase, output its answer, followed by a newline character.

Sample Input  Download

Sample Output  Download

Tags




Discuss