CF449C.Jzzhu and Apples

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Jzzhu has picked nn apples from his big apple tree. All the apples are numbered from 11 to nn . 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?

输入格式

A single integer nn (1<=n<=105)(1<=n<=10^{5}) , the number of the apples.

输出格式

The first line must contain a single integer mm , representing the maximum number of groups he can get. Each of the next mm 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.

输入输出样例

  • 输入#1

    6
    

    输出#1

    2
    6 3
    2 4
    
  • 输入#2

    9
    

    输出#2

    3
    9 3
    2 4
    6 8
    
  • 输入#3

    2
    

    输出#3

    0
    
首页