Codeforces Round #270 1001
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
#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的更多相关文章
- Codeforces Round #270 1003
Codeforces Round #270 1003 C. Design Tutorial: Make It Nondeterministic time limit per test 2 second ...
- Codeforces Round #270 1002
Codeforces Round #270 1002 B. Design Tutorial: Learn from Life time limit per test 1 second memory l ...
- Codeforces Round #270 A~D
Codeforces Round #270 A. Design Tutorial: Learn from Math time limit per test 1 second memory limit ...
- Codeforces Round #270(利用prim算法)
D. Design Tutorial: Inverse the Problem time limit per test 2 seconds memory limit per test 256 mega ...
- codeforces水题100道 第七题 Codeforces Round #270 A. Design Tutorial: Learn from Math (math)
题目链接:http://www.codeforces.com/problemset/problem/472/A题意:给你一个数n,将n表示为两个合数(即非素数)的和.C++代码: #include & ...
- 多种方法过Codeforces Round #270的A题(奇偶法、打表法和Miller_Rabin(这个方法才是重点))
题目链接:http://codeforces.com/contest/472/problem/A 题目: 题意:哥德巴赫猜想是:一个大于2的素数一定可以表示为两个素数的和.此题则是将其修改为:一个大于 ...
- Codeforces Round #270 D Design Tutorial: Inverse the Problem --MST + DFS
题意:给出一个距离矩阵,问是不是一颗正确的带权树. 解法:先按找距离矩阵建一颗最小生成树,因为给出的距离都是最短的点间距离,然后再对每个点跑dfs得出应该的dis[][],再对比dis和原来的mp是否 ...
- Codeforces Round #270 D C B A
谈论最激烈的莫过于D题了! 看过的两种做法不得不ORZ,特别第二种,简直神一样!!!!! 1th:构造最小生成树. 我们提取所有的边出来按边排序,因为每次我们知道边的权值>0, 之后每次把边加入 ...
- Codeforces Round #270
A 题意:给出一个数n,求满足a+b=n,且a+b均为合数的a,b 方法一:可以直接枚举i,n-i,判断a,n-i是否为合数 #include<iostream> #include< ...
随机推荐
- xml解析模块
XML XML是可扩展标记语言的缩写,是实现不同语言或程序之间进行数据交换的协议,主要可以对key添加属性. 页面做展示(字符类型的一个xml格式数据)\做配置文件(内部xml格式的数据).,每一个节 ...
- PhpStorm 默认快捷键
ctrl+j 插入活动代码提示ctrl+alt+t 当前位置插入环绕代码alt+insert 生成代码菜单Shift + Enter 新一行ctrl+ ...
- EmgnCv进行轮廓寻找和计算物体凸包
http://blog.csdn.net/qq_22033759/article/details/48029493 一.轮廓寻找 用的是FindContours函数,在CvInvoke中 不过需要用到 ...
- sql附加数据库错误5120
http://zhidao.baidu.com/link?url=p1o8EjUhn-RYFt1D4uIM-5HQF1oXZIRlPGaDiZ2FRMDzZDG1ooSARfkoPWG6SzTJTN6 ...
- ServiceStack.Text 更快的序列化
Json.net 是以前最经常用的序列化组件,后来又注意到ServiceStack号称最快的,所以我做了以下测试 1)Json.net using System; using System.Colle ...
- WinForm------Reflector反编译工具下载
地址: http://www.ddooo.com/softdown/70642.htm
- hbase shell command
进入hbase shell console $HBASE_HOME/bin/hbase shell 如果有kerberos认证,需要事先使用相应的keytab进行一下认证(使用kinit命令),认证成 ...
- redis哨兵配置
redis哨兵配置主从 redis哨兵的启动和redis实例的启动没有关系.所以可以在任何机器上启动redis哨兵.至少要保证有两个哨兵在运行,要不然宕机后哨兵会找不到主节点. 配置步骤: 1.在 ...
- Java——TCP
import java.io.PrintStream; import java.net.ServerSocket; import java.net.Socket; //================ ...
- CodeForces - 699B One Bomb
题目地址:http://codeforces.com/contest/699/problem/B 题目大意: 一个矩阵,内容由‘.’和‘*’组成(‘.’ 空,‘*’ 代表墙),墙分布在不同位置,现找出 ...