PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000074. Cân bằng ƯCLN và BCNN (GCD vs LCM)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Cân bằng ƯCLN và BCNN (GCD vs LCM)
GCD vs LCM
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given a positive integer , find four positive integers whose sum is and such that . A solution always exists; any valid quadruple is accepted.
Input
One integer .
Output
Print four positive integers in this order.
Subtasks
-
Subtask 1 (20 points): .
-
Subtask 2 (30 points): .
-
Subtask 3 (50 points): .
Examples
Input
7
Output
4 1 1 1
Explanation
All four numbers are positive and sum to . Also, , so the construction is valid.