Codeforces Round 257 (Div. 1)
C
Jzzhu and Apples
Codeforces
2500
原题
← BD →
翻译中…

Jzzhu has picked $*n*$ apples from his big apple tree. All the apples are numbered from $1$ to $*n*$. Now he wants to sell them to an apple store.

翻译中…

Jzzhu will pack his apples into groups and then sell them. Each group must contain two apples, and the greatest common divisor of numbers of the apples in each group must be greater than 1. Of course, each apple can be part of at most one group.

翻译中…

Jzzhu wonders how to get the maximum possible number of groups. Can you help him?

翻译中…

Input

翻译中…

A single integer $*n*$ $(1 ≤ *n* ≤ 10^{5})$, the number of the apples.

翻译中…

Output

翻译中…

The first line must contain a single integer $*m*$, representing the maximum number of groups he can get. Each of the next $*m*$ lines must contain two integers — the numbers of apples in the current group.

翻译中…

If there are several optimal answers you can print any of them.

翻译中…

样例

Input #1
6
Output #1
2
6 3
2 4
InputCopy OutputCopy
Input #2
9
Output #2
3
9 3
2 4
6 8
InputCopy OutputCopy
Input #3
2
Output #3
0
InputCopy OutputCopy
题目信息
题号
449C
时间限制
1 s
内存限制
256 MB
标签
构造
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。