QOJ.ac

QOJ

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

#10241. 水族馆 [C]

الإحصائيات

你决定为你的金鱼买一个新的鱼缸。在鱼缸店里,你有非常多的选择:你可以购买一个底面为 $a \times b$、高为 $h$ 的长方体鱼缸,其中 $a, b, h$ 可以是任意正整数。

你的金鱼喜欢做早操,作为热身,它会沿着鱼缸的一条对角线来回游动。鱼缸对角线的长度公式为 $\sqrt{a^2 + b^2 + h^2}$。

为了方便金鱼计算它当天游过的距离,你希望对角线的长度也是一个整数。此外,鱼缸不能太大,因此对角线的长度必须不超过 $n$。

有多少种不同的鱼缸满足所有要求?如果两个鱼缸的高度不同,或者底面的无序对 $\{a, b\}$ 不同,则认为这两个鱼缸是不同的(底面为 $a \times b$、高为 $h$ 的鱼缸与底面为 $b \times a$、高为 $h$ 的鱼缸被视为相同)。

由于本题的特殊性,禁止在论坛上分享本题的测试数据!

输入格式

输入仅一行,包含一个整数 $n$ ($1 \le n \le 5000$),表示鱼缸对角线的长度上限。

输出格式

输出一个整数,表示满足题目条件的鱼缸总数。

样例

输入 1

7

输出 1

7

说明 1

可能的鱼缸如下: 底面 $1 \times 2$,高 $2$,对角线 $3$。 底面 $2 \times 2$,高 $1$,对角线 $3$。 底面 $2 \times 4$,高 $4$,对角线 $6$。 底面 $4 \times 4$,高 $2$,对角线 $6$。 底面 $2 \times 3$,高 $6$,对角线 $7$。 底面 $2 \times 6$,高 $3$,对角线 $7$。 * 底面 $3 \times 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.