#SP0000120. Tuyển thủy thủ cho thuyền trưởng Flint (Captain Flint and Crew Recruitment)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Tuyển thủy thủ cho thuyền trưởng Flint (Captain Flint and Crew Recruitment)
Captain Flint and Crew Recruitment
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Captain Flint calls a positive integer nearly prime if , where are two distinct prime numbers. For example, and are nearly prime, but is not.
Given , determine whether it can be represented as the sum of four pairwise distinct positive integers, with at least three nearly prime summands. Output any valid construction if possible.
Input
One line containing integer .
Output
Print NO if impossible. Otherwise, print YES on the first line and four pairwise distinct positive integers summing to on the second line, at least three of which are nearly prime.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
36
Output
YES
6 10 15 5
Explanation
We have , , and , so at least three summands are nearly prime. The four numbers are pairwise distinct and sum to . The alternative would be invalid because appears twice.