PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000084. Chia N thành ba số với BCNN nhỏ (k-LCM (easy version))
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Chia N thành ba số với BCNN nhỏ (k-LCM (easy version))
k-LCM (easy version)
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given and with in this version, find exactly positive integers whose sum equals and whose LCM is at most . A valid construction always exists; output any valid one.
Input
One line containing and .
Output
Print exactly positive integers satisfying both conditions.
Subtasks
-
Subtask 1 (20 points): , .
-
Subtask 2 (30 points): , .
-
Subtask 3 (50 points): , .
Examples
Input
8 3
Output
4 2 2
Explanation
The three numbers sum to , and their LCM is , which does not exceed .