QOJ.ac

QOJ

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

#22468. 奶牛伙伴

Statistics

Bessie 和其他所有奶牛的耳朵上都有一个 RFID 序列号标签,以便 FJ 用机器清点她们。许多奶牛都有一个“伙伴”,其序列号等于这头奶牛自身序列号的所有约数(不包括该数本身)之和。有些奶牛没有伙伴,因为没有奶牛的序列号与她们的约数之和相等。

有些奶牛有超级伙伴。如果两头奶牛的序列号使她们互为伙伴,就称她们是超级伙伴。自己是自己的超级伙伴的奶牛会被排斥;不要考虑她们!

给定一个序列号 $S$($6 \le S \le 18,000$),找出序列号至少为 $S$ 且拥有超级伙伴的第一头奶牛。

例如,考虑序列号 $220$,它的约数为 $1,2,4,5,10,11,20,22,44,55,110$,总和为 $284$。类似地,$284$ 的约数为 $1,2,4,71,142$,总和为 $220$。

输入格式

  • 第 1 行:一个整数 $S$。

输出格式

  • 第 1 行:一行中两个用空格分隔的整数,分别是序列号不小于 $S$ 的第一头拥有超级伙伴的奶牛的序列号,以及她的伙伴的序列号。

样例

输入格式 1

206

输出格式 1

220 284

题目来源:Traditional,2010

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.