Codeforces Round 889 (Div. 1)
E
Game Bundles
Codeforces
3000
原题
← DF →
翻译中…

Rishi is developing games in the 2D metaverse and wants to offer game bundles to his customers. Each game has an associated enjoyment value. A game bundle consists of a subset of games whose total enjoyment value adds up to $60$.

翻译中…

Your task is to choose $k$ games, where $1 \leq k \leq 60$, along with their respective enjoyment values $a_1, a_2, \dots, a_k$, in such a way that exactly $m$ distinct game bundles can be formed.

翻译中…

Input

翻译中…

The input is a single integer $m$ ($1 \le m \le 10^{10}$) — the desired number of game bundles.

翻译中…

Output

翻译中…

The first line should contain an integer $k$ ($1 \le k \le 60$) — the number of games.

翻译中…

The second line should contain $k$ integers, $a_1, a_2, \dots, a_k$ ($1 \le a_1, a_2, \dots, a_k \le 60$) — the enjoyment values of the $k$ games.

翻译中…

Note

翻译中…

In the first sample, any subset of size $3$ is a game bundle. There are $4$ such subsets.

翻译中…

样例

Input #1
4
Output #1
4
20 20 20 20
InputCopy OutputCopy
Input #2
722
Output #2
15
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
InputCopy OutputCopy
Input #3
1
Output #3
1
60
InputCopy OutputCopy
题目信息
题号
1854E
时间限制
3 s
内存限制
512 MB
标签
暴力
构造
动态规划
贪心
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。