QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 512 MB 總分: 100

#17581. Math Problem

统计

Determine for each positive integer $n$ in the interval $[L, R]$ whether it can be the area of a right-angled triangle with rational side lengths.

Input

A single line containing two positive integers $L$ and $R$.

Output

A string consisting of $0$s and $1$s, representing whether it is possible for each integer in the range $[L, R]$ respectively.

Examples

Input 1

1 6

Output 1

000011

Note 1

Only $5$ and $6$ satisfy the condition. $5$ is the area of a right-angled triangle with side lengths $\frac{20}{3}, \frac{3}{2}, \frac{41}{6}$. $6$ is the area of a right-angled triangle with side lengths $3, 4, 5$.

Constraints

For $30\%$ of the data, $1 \leqslant L \leqslant R \leqslant 10$.

For $50\%$ of the data, $1 \leqslant L \leqslant R \leqslant 100$.

Additionally, for $20\%$ of the data, $R - L \leqslant 3$.

For $100\%$ of the data, $1 \leqslant L \leqslant R \leqslant 5 \times 10^5$.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1206EditorialOpenEditorial and Several Reference MaterialsQingyu2026-03-05 03:52:27View

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.