Plus
题号:NC237298
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Given , you need to find all pairs  such that:

  • .
  •  are all primes.
  •  is a prime.

输入描述:

One line contains one integer . ()

输出描述:

In the first line, output the number of pairs  you found.

Then each line contains two integers, indicating  and .

If there are multiple pairs , you should output them in the increasing order.  if and only if  or ( and ).

示例1

输入

复制
2

输出

复制
0
示例2

输入

复制
3

输出

复制
1
2 3