12797 - Unlimited Triangle Work   

Description

Recently, Gilgamesh found that he's almost lack of swords in his vault, so he wants to forge a lot of swords with different shapes. He command you to forge for him!

Gilgamesh's sword can only be forged by triangle. Different triangle can be forged into a unique sword. He will give you the intervals of the edges of triangles, you have to calculate how many swords with different shape can he get?

king

Gilgamesh threats you with his "Gate of Babylon".


You are given four positive integer , you're going to count how many triangle that can be build by edges with length , where .

For example:

You can build triangles with edges : .

So the answer is 4.

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