hewmatt10's Card

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

hewmatt10 is making a birthday card for the love of his life, [REDACTED]! However, because hewmatt10 can't draw a heart, he has resorted to drawing a circle. hewmatt10 wants to draw R different concentric circles centred on (0, 0), with the i^{th} circle having a radius of \sqrt{i}. To do this, he needs to know all the integer-valued coordinates points that lie on any of the circles. However, because hewmatt10 doesn't have the capacity to visualize all the points, he only asks for the number. Please help him!

Input Specification

The first line contains R\ (1 \le R \le 10^9).

Output Specification

The number of integer-valued points that lie on any of the circles.

Subtasks

Subtask 1 [30%]

R \le 10^5

Subtask 2 [70%]

No further constraints.

Sample Input

25

Sample Output

80

Comments

There are no comments at the moment.