zoj4099(思维)

Extended Twin Composite Number
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

以后遇到special judge一定要有奇奇怪怪的想法!!
!!!防止看到题解都很懵逼
至于为啥乘以8和9,因为8,9是最小的两个相差一的合数,不用给1加特判啦

#include<bits/stdc++.h>
using namespace std;
int main()
{
   
 int t;
 scanf("%d",&t);
 while(t--)
    {
   
  long long temp;
  scanf("%lld",&temp);
  long long x=temp*8;
  long long y=temp*9;
  printf("%lld %lld\n",x,y);
 }
    return 0;
}

全部评论

相关推荐

10-21 23:48
蚌埠坦克学院
csgq:可能没hc了 昨天一面完秒挂
点赞 评论 收藏
分享
冲芭芭拉鸭:你这图还挺新,偷了。
投递美团等公司10个岗位
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务