303886: CF749A. Bachgold Problem

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Bachgold Problem

题意翻译

给你一个整数$n$ ($2\leq n\leq 100000$ ),问最多能将其分解成多少质数的和。在第一行输出最多的质数数量$k$ ,下一行输出$k$ 个整数,为这些质数。 一个大于$1$ 的数如果只能被$1$ 和它自己整除,那它就是一个质数。 By @Khassar

题目描述

Bachgold problem is very easy to formulate. Given a positive integer $ n $ represent it as a sum of maximum possible number of prime numbers. One can prove that such representation exists for any integer greater than $ 1 $ . Recall that integer $ k $ is called prime if it is greater than $ 1 $ and has exactly two positive integer divisors — $ 1 $ and $ k $ .

输入输出格式

输入格式


The only line of the input contains a single integer $ n $ ( $ 2<=n<=100000 $ ).

输出格式


The first line of the output contains a single integer $ k $ — maximum possible number of primes in representation. The second line should contain $ k $ primes with their sum equal to $ n $ . You can print them in any order. If there are several optimal solution, print any of them.

输入输出样例

输入样例 #1

5

输出样例 #1

2
2 3

输入样例 #2

6

输出样例 #2

3
2 2 2

Input

题意翻译

给你一个整数$n$ ($2\leq n\leq 100000$ ),问最多能将其分解成多少质数的和。在第一行输出最多的质数数量$k$ ,下一行输出$k$ 个整数,为这些质数。 一个大于$1$ 的数如果只能被$1$ 和它自己整除,那它就是一个质数。 By @Khassar

加入题单

上一题 下一题 算法标签: