4965. XY_cpp's Sqrt

单点时限: 2.0 sec

内存限制: 512 MB

XY_cpp is learning Concrete Math, and he sees the $O(1)$ method to solve $\sum_{k=1}^n\sqrt{k}$. It so happens that XY_cpp’s best friend GCY is learning math. So XY_cpp decides to put her to the test. However, GCY thinks it is too hard for her to calculate the general equation, and she asks for a lower level of difficulty. So XY_cpp gives her this problem instead:

Caculate the value of the following equation:
$$
\sum_{k=1}^n\left\lfloor\sqrt{\frac{k+514}{114}}\right\rfloor
$$

Could you help pool GCY?

输入格式

The first line contains an integer $T\ (1\le T\le10^4)$.

In the following $T$ lines, each line contains a integer $n\ (0\le n\le 10^9)$.

输出格式

$T$ lines, each line has one integer.

The $i$th line denots the answer to the $i$th quation.

样例

Input
5
5
17
73
97
76
Output
10
34
146
194
152
Input
6
258503958
370231976
819140588
535936902
72463931
494080578
Output
259383316635
444618282352
1463433091860
774421111620
38480001172
685483769799

提示

$\lfloor x\rfloor$ denotes rounding down $x$.

210 人解决,322 人已尝试。

218 份提交通过,共有 783 份提交。

3.3 EMB 奖励。

创建: 1 年,6 月前.

修改: 1 年,6 月前.

最后提交: 1 年前.

来源: N/A

题目标签