#P7779. 『JROI-2 / Stoi2039』等你下课
『JROI-2 / Stoi2039』等你下课
Description
Given a positive integer , define
$$S_v=\{(x,y):x,y \in \mathbb{Z_{\ge 0}},x^2-dy^2=v\}$$Compute:
$$\sum_{v=1}^{\lfloor\sqrt{d}\rfloor}v[S_v \neq \varnothing]$$There are multiple queries.
Input Format
The first line contains a positive integer , which indicates the number of queries.
The next lines each contain a positive integer , representing one query.
Output Format
For each query, output one line containing one integer, which is the answer.
4
10
13
16
19
1
4
5
5
Hint
Sample Explanation
- For , only satisfies .
- For , satisfy .
- For , satisfy .
- For , satisfy .
Constraints
- For of the testdata, , .
- For of the testdata, .
- For of the testdata, , .
Source: JROI-2 Summer Fun Round - T4.
Idea & Solution & Standard & Data: VinstaG173.
Retest: None.
Translated by ChatGPT 5
京公网安备 11011102002149号