#abc372b. B - 3^A
B - 3^A
Score : points
问题陈述
给定一个正整数 。找到一个正整数 和一个非负整数序列 ,满足以下所有条件:
可以证明,在这些约束条件下,总是存在至少一对满足条件的 和 。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
You are given a positive integer . Find a positive integer and a sequence of non-negative integers that satisfy all of the following conditions:
It can be proved that under the constraints, there always exists at least one such pair of and satisfying the conditions.
Constraints
Input
The input is given from Standard Input in the following format:
Output
Print and satisfying the conditions in the following format:
If there are multiple valid pairs of and , any of them is acceptable.
Sample Input 1
6
Sample Output 1
2
1 1
For example, with and , we have , satisfying all conditions.
Another example is and , which also satisfies the conditions.
Sample Input 2
100
Sample Output 2
4
2 0 2 4
Sample Input 3
59048
Sample Output 3
20
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9
Note the condition .