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< ...
随机推荐
- Myeclipse如何设置字体大小
由于Myeclipse一般是英文版的,这就给英语不太好的人带来了一定的麻烦,有时连设置个字体都无法顺利进行!!! 工具/原料 Myeclipse 方法/步骤 双击启动Myeclipse 点击& ...
- ASP.NET 递归将分类绑定到 TreeView
CREATE TABLE [dbo].[sysMenuTree]([NoteId] [decimal](18, 0) NOT NULL,[ParentId] [decimal](18, 0) NULL ...
- MongoDb学习1
目标框架必须是 4.5以上,最新MongoDb.Driver 是 2.2.4(与MongoDb.Driver 的1.x版本差别较大) 官方文档 http://mongodb.github.io/mon ...
- Java——字符集:Charset
- Java——IP和InetAddress
import java.net.InetAddress; //================================================= // File Name : Inet ...
- webkit的一些不为人知的高级属性
1.-webkit-tap-highlight-color tap按钮或者链接时,就会出现一个半透明的灰色背景,设置属性: -webkit-tap-highlight-color:transpar ...
- Object Graph Serialization
http://coding-time.blogspot.com/2008/03/serialize-object-graph-to-xml-in-net.html http://trycatch.me ...
- 服务器后台TCP连接存活问题
0. 背景 公司的服务器后台部署在某一个地方,接入的是用户的APP,而该地方的网络信号较差,导致了服务器后台在运行一段时间后用户无法接入,那边的同事反馈使用netstat查看系统,存在较多的TCP连接 ...
- sql FOR XML PATH
FOR XML PATH 有的人可能知道有的人可能不知道,其实它就是将查询结果集以XML形式展现,有了它我们可以简化我们的查询语句实现一些以前可能需要借助函数活存储过程来完成的工作.那么以一个实例为主 ...
- Linux下的压缩解压缩命令详解
linux zip命令zip -r myfile.zip ./*将当前目录下的所有文件和文件夹全部压缩成myfile.zip文件,-r表示递归压缩子目录下所有文件. 2.unzipunzip -o - ...