Preparando MOJI

Game Bundles

3000ms 524288K

Description:

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.

Sample Input:

4

Sample Output:

4
20 20 20 20

Sample Input:

722

Sample Output:

15
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

Sample Input:

1

Sample Output:

1
60

Note:

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

Informação

Codeforces

Provedor Codeforces

Código CF1854E

Tags

brute forceconstructive algorithmsdpgreedymath

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 10:41:11

Relacionados

Nada ainda