P17098 [ICPC 2017 Qingdao R] Pythagoras, One More Time

Description

“Pythagoras, One More Time” triples over $n$ are all solutions of $x^2 + y^2 = z^2 - 7$ where $x$, $y$ and $z$ are constrained to be positive integers less than or equal to $n$. You are to calculate the number of the triples $(x, y, z)$ such that $x \le y \le z$.

Input Format

The first line is an integer $T$ ($1 \le T \le 10000$) indicating the total number of cases. For each test case a line contains the integer $n$ ($1 \le n \le 10^8$).

Output Format

For each case output the total number of triples in a line.