QOJ.ac

QOJ

时间限制: 1.0 s 内存限制: 512 MB 总分: 100 可 Hack ✓

#14541. 多个集合

统计

彼得对数学非常痴迷。他经常研究有趣的数学问题。有一次,他对倍数问题产生了兴趣。设 $S_{[L,R]}(x)$ 为区间 $[L, R]$ 内 $x$ 的倍数集合。形式化地,$S_{[L,R]}(x) = \{d \mid L \le d \le R, x \mid d\}$。

他将一个集合的权重定义为该集合中所有元素的和。然后,他将 $S_{[L,R]}(x)$ 的所有非空子集的权重相加,得到结果 $K$。

不幸的是,彼得丢三落四。在完成计算任务后,他忘记了初始的 $x$ 是什么。然而,他写下了区间 $[L, R]$ 和结果 $K$。现在他想让你——一位聪明的 XCPCer,告诉他所有可能的 $x$。

输入格式

本题包含多组测试数据。

第一行包含一个整数 $T$ ($1 \le T \le 100$),表示彼得完成的计算任务数量。

接下来的 $T$ 行中,每行包含三个整数 $L, R$ ($1 \le L \le R \le 10^{12}$) 和 $K$ ($1 \le K \le 10^{14}$),分别表示区间和结果。

输出格式

对于每个任务,如果没有合法的 $x$,输出 No Solution。如果合法的 $x$ 的数量超过 $10^5$,输出 Too Many!。否则,在第一行输出合法 $x$ 的数量,然后在下一行按升序输出所有合法的 $x$,用空格隔开。

样例

样例输入 1

10
25 37 25
10 38 28
53 112 82
343 1839 1373
2451576 8343226 60034488
3402021 5387344 3855560
1332880393 1809278150 6322710186
79896573 1625195292 12360010488
217028134566 876902973439 657118365564
693979750091 779344640488 2981730890110

样例输出 1

1
25
1
28
2
41 82
1
1373
1
2501437
2
1927780 3855560
2
243181161 351261677
1
515000437
1
657118365564
1
42596155573

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.