Do you know the twin prime conjecture? Two primes  and  are called twin primes if . The twin prime conjecture is an unsolved problem in mathematics, which asks for a proof or a disproof for the statement "there are infinitely many twin primes".

On April 17, 2013, Yitang Zhang announced a proof that for some integer  that is less than 70 million, there are infinitely many pairs of primes that differ by . As of April 14, 2014, one year after Zhang's announcement, the bound has been reduced to 246. People are hoping for the bound to be smaller and smaller, so that a proof for the conjecture can finally be found.

For our dear contestants, we've prepared another similar problem for you, which is the extended twin composite number problem: Given a positive integer , find two integers  and  such that  and both  and  are composite numbers.

Input

There are multiple test cases. The first line of the input contains an integer  (about ), indicating the number of test cases. For each test case:

The only line contains one integer  ().

Output

For each test case output two integers in one line, indicating  and  where . If there are multiple valid answers, you can print any of them; If there is no valid answer, output "-1" (without quotes) instead.

Sample Input

3
11
1805296
5567765

Sample Output

4 15
114514 1919810
111234 5678999

Author: JIN, Mengge
Source: The 19th Zhejiang University Programming Contest Sponsored by TuSimple


水题,特别能迷惑人。

代码:

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring> using namespace std; int main() {
int t,n;
scanf("%d",&t);
while(t --) {
scanf("%d",&n);
if(n == ) printf("%lld %lld\n",,);
else printf("%lld %lld\n",n * 2ll,n * 3ll);
}
}

最新文章

  1. 【数学】Matrix Multiplication
  2. Synchronized快
  3. ReaderWriterLock的UpgradeToWriterLock方法的一种使用场景
  4. Bash Shell字符串操作小结
  5. MyEclipse设置编码方式 转载【http://www.cnblogs.com/susuyu/archive/2012/06/27/2566062.html】
  6. IGT一道笔试题
  7. python 源码解析
  8. Java基础知识强化之IO流笔记17:FileOutputStream构造方法使用
  9. asp.net C# 导出EXCEL数据
  10. C# 缩略图算法
  11. django分页linaro-django-pagination
  12. c# serialport读取不限数量的16进制数据
  13. bone collector hdu 01背包问题
  14. 完美实现身份证校验 js正则
  15. SublimeText 自带格式化代码功能
  16. 【ActiveReports 大数据分析报告】用数据分析的手段告诉你,复联4有多火爆?
  17. openmp入门总结
  18. 数据库语句收藏(MySQL)
  19. 【Java】 剑指offer(21) 调整数组顺序使奇数位于偶数前面
  20. linux命令学习(4):cd命令

热门文章

  1. 【OpenGL开发】GLUT/freeglut 是什么? OpenGL 和它们有什么关系?
  2. java后端通过request对象获取请求的ip地址工具类
  3. Jenkins+maven+gitlab自动化部署之docker发布sprint boot项目(七)
  4. str.format() 格式化数字的多种方法
  5. TZOJ1299: 畅通工程
  6. oracle随笔之提示“ORA-01002: 提取违反顺序”
  7. 1byte、1KB、4KB,1MB、1GB用16进制表示的范围。任意地址范围求字节数
  8. DataSource配置
  9. Mybatis的实现原理
  10. linux之rename和mv的区别