PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000104. Dãy số có tính chất ƯCLN đặc biệt (GCD Sequence)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Dãy số có tính chất ƯCLN đặc biệt (GCD Sequence)
GCD Sequence
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Construct a set of exactly distinct positive integers not exceeding . The GCD of all elements must be . For every , the GCD of and the sum of all other elements of must be greater than . Print the numbers in any order; a solution always exists.
Input
One line containing an integer .
Output
Print exactly distinct positive integers, each at most , satisfying all requirements.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
3
Output
2 5 63
Explanation
One valid output is 2 5 63. Their overall GCD is . Moreover, , , and , all greater than .