QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22586. Bedtime Reading, II

Statistics

Restored statement: the original English problem page was not recovered. This version is reconstructed from the official analysis and archived input/output data.

Farmer John is continuing Bessie's number theory bedtime reading. For a positive integer n, let s(n) be the sum of its proper divisors (all positive divisors smaller than n). Repeatedly applying s produces an aliquot sequence. For example, starting with 12 gives 12, 16, 15, 9, 4, 3, 1.

A cycle starting at n is a sequence that eventually returns to n. For every starting integer in a given inclusive range, find and print its cycle if the sequence returns to that starting integer without first reaching a smaller integer. Each cycle is printed once, beginning with its starting integer. A cycle may contain numbers larger than the upper end of the input range.

Input

  • Line 1: Two integers, A and B $(1 \le A \le B \le 2,000,000)$.

Output

For each starting integer in the input range whose aliquot sequence returns to it before reaching a smaller value, print the sequence on one line, with its integers separated by spaces.

Examples

Input 1

200 1200

Output 1

220 284
496
1184 1210

Problem credits: Traditional; Year: 2006.

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.