QOJ.ac

QOJ

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

#10241. Aquarium [C]

统计

You have decided to buy a new aquarium for your goldfish. In the aquarium shop, you have a very large selection: you can buy a rectangular cuboid aquarium with a base of $a \times b$ and height $h$ for any positive integer dimensions $a, b,$ and $h$.

Your fish likes to do morning exercises and, as a warm-up, swims back and forth along one of the diagonals of the aquarium. The length of the aquarium's diagonal is given by the formula $\sqrt{a^2 + b^2 + h^2}$.

To make it easier for the fish to calculate how far it has swum on a given day, you want the length of the diagonal to also be an integer. An aquarium that is too large is out of the question, so the length of its diagonal must be at most $n$.

How many different aquariums meet all the requirements? Two aquariums are considered different if they have a different height or a different unordered pair $\{a, b\}$ (an aquarium with base $a \times b$ and height $h$ is the same as an aquarium with base $b \times a$ and height $h$).

Due to the nature of this problem, sharing tests for this task on the forum is prohibited!

Input

The only line contains a single integer $n$ ($1 \le n \le 5000$), representing the limit on the aquarium's diagonal.

Output

Output a single integer — the number of different aquariums that satisfy the problem conditions.

Examples

Input 1

7

Output 1

7

Note

The possible aquariums are: Base $1 \times 2$, height $2$, diagonal $3$. Base $2 \times 2$, height $1$, diagonal $3$. Base $2 \times 4$, height $4$, diagonal $6$. Base $4 \times 4$, height $2$, diagonal $6$. Base $2 \times 3$, height $6$, diagonal $7$. Base $2 \times 6$, height $3$, diagonal $7$. * Base $3 \times 6$, height $2$, diagonal $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.