PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000154. Bộ câu hỏi chia hết tối ưu (Vasya and Petya's Game)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Bộ câu hỏi chia hết tối ưu (Vasya and Petya's Game)

Vasya and Petya's Game

Source: Codeforces 576A
Version: Phuoc Hung OJ Extended — one dataset per judge run.

Problem Statement

An unknown integer xx belongs to [1,n][1,n]. You may ask divisibility questions for chosen values yy, all at once. Output a minimum-size set of questions that uniquely determines every possible xx. Any optimal set is accepted.

Input

One line containing the integer nn.

Output

Print the minimum number kk of questions, followed by kk distinct values yiy_i in [1,n][1,n]. Any order is accepted.

Subtasks

  • Subtask 1 (20 points): 1≤n≤301\le n\le 30.
  • Subtask 2 (30 points): 1≤n≤3001\le n\le 300.
  • Subtask 3 (50 points): 1≤n≤10001\le n\le 1000.

Example

Input

4

Output

3
2 4 3

Explanation

The three questions 2,4,32,4,3 distinguish all possibilities 1,2,3,41,2,3,4. No set of two questions suffices.