ZOJ 2019校赛 J Extended Twin Composite Number_zoj2019-程序员宅基地

技术标签: C  ZOJ  水题  

157 - The 19th Zhejiang University Programming Contest Sponsored by TuSimple (Mirror) - J Extended Twin Composite Number

Time Limit: 1 Second Memory Limit: 65536 KB Special Judge

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

大声bb

题目里说了任意一组满足条件的解都可以
再一看数据也不是很大(没爆long long)也许吧,我乱说的
直接乘8乘9就完事了

#include<bits/stdc++.h>
#include <iostream>
#include<string>
#include<cmath>
typedef long long ll;
using namespace std;

int main()
{
    
	int t;
	scanf("%d",&t);
	while(t--){
    
		ll temp;
		scanf("%lld",&temp);
		ll x=temp*8;
		ll y=temp*9;
		printf("%lld %lld\n",x,y);
	}
    return 0;
}
 
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_44702847/article/details/89302713

智能推荐

SDIO WiFi Card Driver_rtw: error [halmac][err]sdio indirect cmd53 read-程序员宅基地

文章浏览阅读1.5w次。(1) Wifi卡的常用接口有: –CF 接口 –USB接口 –SDIO接口 –SPI接口 –PCMCIA接口 很多时候,同一个wifi卡同时支持多种接口,譬如marvell的8686的wifi卡,既支持spi接口,也支持sdio接口. (2) SD卡与SDIO卡的异同1.SD卡使用的是SD卡协议,而SDIO卡使用的是SDIO协议;协议不一样,初始化/读写方_rtw: error [halmac][err]sdio indirect cmd53 read

JAVA中的Math()_java math();-程序员宅基地

文章浏览阅读623次。java.math.Math类常用的常量和方法:Math.PI 记录的圆周率Math.E记录e的常量Math.abs 求绝对值Math.sin 正弦函数 Math.asin 反正弦函数Math.cos 余弦函数 Math.acos 反余弦函数Math.tan 正切函数 Math.atan 反正切函数 Math.atan2 商的反正切函数Math.toDeg_java math();

程序员毕业五年他年薪百万,他月薪一万_一万工资的程序员c++-程序员宅基地

文章浏览阅读267次。工作五年是个分水岭,大部分程序员从初级工程师成长为中高级工程师,薪资较刚毕业时翻几番。同一个宿舍毕业的人有不同的发展轨道,有人年薪百万,有人仍在基层搬砖。小编采访几位工作五年的程序员,谈谈他们的现状。蒋远航:专注在一家公司里走技术管理路线,现不写代码专注撕逼,月薪2万蒋远航毕业后入职某二线互联网公司,月薪不到一万。头两年和其他程序员一样,写些基础性的业务代码。在大学身为班长的蒋..._一万工资的程序员c++

飛飛(四十一)建立一个Point类,包含数据成员x,y......._建立一个point类,包括坐标x,y二个成员变量。通过继承得到cube类,增加一个z坐标。实现求面积-程序员宅基地

文章浏览阅读7.3k次。嘿_建立一个point类,包括坐标x,y二个成员变量。通过继承得到cube类,增加一个z坐标。实现求面积和体积的方法。java

C++第五次上机实验其他作业_程序填空:#include <iostream> 5#include <string>usi-程序员宅基地

文章浏览阅读265次。项目1:程序填空#include#includeusing namespace std;class Person{ string name; //姓名 int age; //年龄public: Person(){} void setname(string na) { name=na; } void setage(int a) { age=a; }_程序填空:#include 5#include usi

boost.python入门教程 ----python 嵌入c++_python文件引入c++ 引入boost库-程序员宅基地

文章浏览阅读821次。http://www.cnblogs.com/rocketfan/archive/2009/11/15/1603400.htmlboost.python 中 python 嵌入c++ 部分,网上找到的中文资料似乎都有些过时了,如 boost.python学习笔记 http://edyfox.codecarver.org/html/boost_python.html在bo_python文件引入c++ 引入boost库

随便推点

socket 怎么设置心跳判断连接-程序员宅基地

文章浏览阅读360次。------解决方案--------------------------------------------------------在定时器里隔段时间就发送几个字节的数据。如果3次没有返回则断开 ------解决方案--------------------------------------------------------客户端:30秒发送一个心跳包到服务器服务器:接收到心跳包,更新..._socket_create 心跳连接

AES分组加密使用示例-程序员宅基地

文章浏览阅读123次。AES分组加密使用示例示例1/* tomcrypt(http://libtomcrypt.org/) aes分段加密演示。使用前 #include <tomcrypt.h> AES,分段长度16,密钥最大长度32 还支持以下各种分段加密方式,其分段长度和密钥长度参考 crypt.pdf 21页 Blowfish XTEA RC5..._aes_ecb_encrypt 分段加密

机器人模型仿真(turtlebot3)-程序员宅基地

文章浏览阅读1.1w次,点赞27次,收藏211次。文章详细记录了如何将turtlebot3的机器人模型文件集成到自己的项目中,并使用该模型文件在Rviz和Gzebo下进行数据可视化和运动仿真。_turtlebot3

无代码自动化测试的优秀实践与工具_自动化测试工具实践-程序员宅基地

文章浏览阅读7k次。无代码自动化测试的优秀实践与工具_自动化测试工具实践

中国半挂车行业投资前景预测与十四五投资战略规划分析报告2021年版_挂车企业发展环境-程序员宅基地

文章浏览阅读4.3k次。第1章:半挂车行业界定及数据统计标准说明1.1 半挂车的界定1.1.1 半挂车的界定1.1.2 半挂车相关概念辨析(1)挂车与牵引车(2)半挂车与全挂车(3)半挂车与半挂牵引车1.2 半挂车行业分类1.3 半挂车行业专业术语介绍1.4 半挂车所归属国民经济行业分类1.5 本报告研究范围界定说明1.6 本报告数据来源及统计标准说明第2章:中国半挂车行业宏观环境分析(PEST)2.1 中国半挂车行业政策(Policy)环境分析2.1.1 半挂车行业监管体..._挂车企业发展环境

java POI导出Excel表格升级_java poi升级-程序员宅基地

文章浏览阅读386次。java POI导出Excel表格升级1、导出效果:2、代码实现3、使用列子这次的代码是在上一篇文章的基础上加以修改得来,可以适应更多的场景。可以动态添加底部数据、合并自由合并列数1、导出效果:2、代码实现package com.paladin.monitor.tuil;import org.apache.poi.ss.usermodel.*;import org.apache.poi.ss.util.CellRangeAddress;import org.apache.poi.xssf._java poi升级