QOJ.ac

QOJ

Time Limit: 0.5 s Memory Limit: 64 MB Total points: 100

#941. 幼儿园小朋友的难题

Statistics

Bajtazar 刚刚从 Bajtocka 师范学校毕业,假期结束后他将开始在幼儿园担任保育员。由于在 Bajtocka,男性担任这一职位对许多孩子来说可能是一件新鲜事,他决定用一个小计谋来赢得孩子们的心。当他第一次见到他的小组时,他会把其中一个口袋翻过来,糖果就会撒在地板上。孩子们绝不会让任何一颗糖果剩下,但对 Bajtazar 来说,非常重要的一点是每个孩子得到的糖果数量必须相等(否则有些孩子可能会不喜欢他)。因此,撒出的糖果数量必须能被孩子的数量整除。

这本来非常简单,但 Bajtazar 不知道他的小组里会有多少个孩子。已知他的裤子有两个口袋,并且知道单个口袋的容量(即口袋里能装多少颗糖果),请帮他选择糖果的数量,以便他能为尽可能多种不同数量的孩子做好准备。

输入格式

输入的第一行也是唯一一行包含一个整数 $n$ ($n \ge 1$),表示 Bajtazar 裤子口袋的容量。

输出格式

第一行应输出一个自然数,表示 Bajtazar 可以准备的方案数。第二行应输出两个不超过 $n$ 的正整数 $x$ 和 $y$,表示 Bajtazar 可以放在两个口袋里的糖果数量,以使他能为尽可能多的孩子数量做好准备。如果存在多组这样的数字对,你可以输出其中任意一组。

样例

输入 1

15

输出 1

8
12 10

说明

样例说明:装有 10 颗糖果的口袋使 Bajtazar 可以应对 1、2、5 或 10 个孩子,而装有 12 颗糖果的口袋可以应对 1、2、3、4、6 或 12 个孩子。Bajtazar 总共可以应对 8 种可能的情况(即 1、2、3、4、5、6、10 和 12)。

子任务

测试集分为以下子任务。每个子任务的测试由一组或多组独立的测试用例组成。

子任务 条件 分值
1 $n \le 200$ 8
2 $n \le 3000$ 7
3 $n \le 1\,000\,000$ 34
4 $n \le 10^{12}$ 23
5 $n \le 10^{16}$ 28

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.