We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

- All Contests
- ProjectEuler+
- Project Euler #251: Cardano Triplets

# Project Euler #251: Cardano Triplets

# Project Euler #251: Cardano Triplets

_{This problem is a programming version of Problem 251 from projecteuler.net}

A triplet of positive integers is called a Cardano Triplet if it satisfies the condition:

For example, is a Cardano Triplet.

There exist Cardano Triplets for which .

Find how many Cardano Triplets exist such that .

**Input Format**

The first line of each test file contains a single integer , which is the number of queries. lines follow, each containing the corresponding .

**Constraints**

OR

OR

**Output Format**

Print exactly lines with the answer to the corresponding query on each one.

**Sample Input 0**

```
2
8
1000
```

**Sample Output 0**

```
1
149
```

**Explanation 0**

is the only triplet with the sum .

**Sample Input 1**

```
2
999999069
999999550
```

**Sample Output 1**

```
172332336
172332416
```