Codeforces Round #270 1001

A. Design Tutorial: Learn from Math

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that.

For example, there is a statement called the "Goldbach's conjecture". It says: "each even number no less than four can be expressed as the sum of two primes". Let's modify it. How about a statement like that: "each integer no less than 12 can be expressed as the sum of two composite numbers." Not like the Goldbach's conjecture, I can prove this theorem.

You are given an integer n no less than 12, express it as a sum of two composite numbers.

Input

The only line contains an integer n(12 ≤ n ≤ 106).

Output

Output two composite integers x and y(1 < x, y < n) such that x + y = n. If there are multiple solutions, you can output any of them.

Sample test(s)

Input

12

Output

4 8

Input

15

Output

6 9

Input

23

Output

8 15

Input

1000000

Output

500000 500000

 
一个大于12的数,可以用两个合数表示。。。。。。
 #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath> using namespace std; int main()
{
int a;
scanf("%d",&a);
if(a%==)
{
cout<<<<' '<<a-<<endl;
}
else
{
cout<<<<' '<<a-<<endl;
}
return ;
}

Codeforces Round #270 1001的更多相关文章

  1. Codeforces Round #270 1003

    Codeforces Round #270 1003 C. Design Tutorial: Make It Nondeterministic time limit per test 2 second ...

  2. Codeforces Round #270 1002

    Codeforces Round #270 1002 B. Design Tutorial: Learn from Life time limit per test 1 second memory l ...

  3. Codeforces Round #270 A~D

    Codeforces Round #270 A. Design Tutorial: Learn from Math time limit per test 1 second memory limit ...

  4. Codeforces Round #270(利用prim算法)

    D. Design Tutorial: Inverse the Problem time limit per test 2 seconds memory limit per test 256 mega ...

  5. codeforces水题100道 第七题 Codeforces Round #270 A. Design Tutorial: Learn from Math (math)

    题目链接:http://www.codeforces.com/problemset/problem/472/A题意:给你一个数n,将n表示为两个合数(即非素数)的和.C++代码: #include & ...

  6. 多种方法过Codeforces Round #270的A题(奇偶法、打表法和Miller_Rabin(这个方法才是重点))

    题目链接:http://codeforces.com/contest/472/problem/A 题目: 题意:哥德巴赫猜想是:一个大于2的素数一定可以表示为两个素数的和.此题则是将其修改为:一个大于 ...

  7. Codeforces Round #270 D Design Tutorial: Inverse the Problem --MST + DFS

    题意:给出一个距离矩阵,问是不是一颗正确的带权树. 解法:先按找距离矩阵建一颗最小生成树,因为给出的距离都是最短的点间距离,然后再对每个点跑dfs得出应该的dis[][],再对比dis和原来的mp是否 ...

  8. Codeforces Round #270 D C B A

    谈论最激烈的莫过于D题了! 看过的两种做法不得不ORZ,特别第二种,简直神一样!!!!! 1th:构造最小生成树. 我们提取所有的边出来按边排序,因为每次我们知道边的权值>0, 之后每次把边加入 ...

  9. Codeforces Round #270

    A 题意:给出一个数n,求满足a+b=n,且a+b均为合数的a,b 方法一:可以直接枚举i,n-i,判断a,n-i是否为合数 #include<iostream> #include< ...

随机推荐

  1. ConurrentHashMap和Hashtable的区别

    转自:http://www.importnew.com/7166.html 集合类是Java API的核心,但是我觉得要用好它们是一种艺术.我总结了一些个人的经验,譬如使用ArrayList能够提高性 ...

  2. Vijos 1816统计数字(计数排序)

    传送门 Description 某次科研调查时得到了n个自然数,每个数均不超过1500000000(1.5*10^9).已知不相同的数不超过10000个,现在需要统计这些自然数各自出现的次数,并按照自 ...

  3. [Android]Volley源码分析(三)

    上篇看了关于Request的源码,这篇接着来看下RequestQueue的源码. RequestQueue类图:

  4. MongoDB的安装及CURD操作

    MongoDB的下载地址:http://www.mongodb.org/downloads MongoDB有32bit和64bit两个版本,32bit只能存放2GB数据.我们选择64bit版进行下载. ...

  5. nginx主备配置

    添加配置: proxy_next_upstream error timeout invalid_header http_500 http_503 http_502; upstream http.wea ...

  6. python学习笔记-(一)初识python

    1.python的前世今生 想要充分的了解一个人,无外乎首先充分了解他的过去和现在:咱们学习语言也是一样的套路 1.1 python的历史 Python(英国发音:/ˈpaɪθən/ 美国发音:/ˈp ...

  7. win 2012 关闭IE增强设置

  8. RandomAccessFile类

    File类只是针对文件本身进行操作,而如果要对文件内容进行操作,则可以使用RandomAccessFile类,此类属于随机读取类,可以随机地读取一个文件中指定位置的数据. //============ ...

  9. hasClass addClass removeClass

    //函数有class function hasClass(ele,cls){ return -1<(" "+ele.className+" ").inde ...

  10. Behavior Trees

    https://en.wikipedia.org/wiki/Behavior_Trees_(artificial_intelligence,_robotics_and_control) http:// ...