QOJ.ac

QOJ

Time Limit: 10 s Memory Limit: 1024 MB Total points: 10

#10241. 水槽 [C]

Statistics

あなたは金魚のために新しい水槽を買うことにしました。水槽専門店には非常に多くの選択肢があり、底面が $a \times b$、高さが $h$ である直方体の水槽を、任意の正の整数 $a, b, h$ に対して購入することができます。

あなたの金魚は朝の運動が好きで、準備運動として水槽の対角線の一辺を往復します。水槽の対角線の長さは、公式 $\sqrt{a^2 + b^2 + h^2}$ で表されます。

金魚がその日どれだけ泳いだかを計算しやすくするために、対角線の長さも整数になるようにしたいと考えています。また、大きすぎる水槽は選択肢に入らないため、対角線の長さは最大でも $n$ でなければなりません。

すべての条件を満たす水槽は何種類あるでしょうか?2つの水槽は、高さが異なるか、あるいは底面の辺の組 $\{a, b\}$ が(順序を考慮しない集合として)異なる場合に、異なるものとみなします(底面が $a \times b$ で高さが $h$ の水槽と、底面が $b \times a$ で高さが $h$ の水槽は同じものとみなします)。

この問題の性質上、この問題のテストケースをフォーラムで共有することは禁止されています!

入力

1行に、水槽の対角線の上限を表す整数 $n$ ($1 \le n \le 5000$) が与えられます。

出力

条件を満たす水槽の種類の数を表す整数を1つ出力してください。

入出力例

入力 1

7

出力 1

7

注記

例の解説: 以下の水槽が可能です。 底面 1 × 2、高さ 2、対角線 3 底面 2 × 2、高さ 1、対角線 3 底面 2 × 4、高さ 4、対角線 6 底面 4 × 4、高さ 2、対角線 6 底面 2 × 3、高さ 6、対角線 7 底面 2 × 6、高さ 3、対角線 7 * 底面 3 × 6、高さ 2、対角線 7

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.