QOJ.ac

QOJ

Limite de temps : 3 s Limite de mémoire : 1024 MB Points totaux : 100 Hackable ✓

#5359. Nation Building

Statistiques

For a long time after the Mian Emperor created the world, the Mian Kingdom remained a wasteland. One day, the Mian Emperor decided to construct some buildings in the Mian Kingdom. According to the Mian Emperor's architectural aesthetics, a perfect building must be a rectangle on a 2D plane with positive integer side lengths, and no two distinct buildings may intersect in any way. The Mian Emperor can build any number of perfect buildings of any shape.

However, although the Mian Kingdom is very prestigious, its resources are extremely scarce. Therefore, the sum of the areas of the rectangles built by the Mian Emperor cannot exceed $S$, and the sum of their perimeters cannot exceed $C$.

Now, the Mian Emperor wants to know how many pairs $(A, B)$ satisfy the following: $1 \leq A \leq S$, $1 \leq B \leq C$, and there exists a construction scheme such that the sum of the areas of the buildings is $A$ and the sum of their perimeters is $B$.

Input

The first line contains two positive integers $S, C$.

Output

Output a non-negative integer representing the number of pairs $(A, B)$ that satisfy the conditions.

Examples

Input 1

4 10

Output 1

7

Subtasks

Task 1 (6 points): $1 \leq S, C \leq 10$

Task 2 (12 points): $1 \leq S, C \leq 10^3$

Task 3 (31 points): $1 \leq S, C \leq 6000$

Task 4 (51 points): $1 \leq S \leq 2 \times 10^5$, $1 \leq C \leq 4 \times 10^5$

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.