Skip to content

Commit dcbd30c

Browse files
committed
Added 472A - Design Tutorial: Learn from Math.cpp
1 parent ba8860a commit dcbd30c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
bool mark[1000001];
6+
7+
// Code Written By: Vikash Patel
8+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
9+
10+
void solv(){
11+
for(ll i = 2; i <=1000000; i++ )
12+
{
13+
if( mark[i] == 0 )
14+
{
15+
for(ll j = 2 * i; j <=1000000; j += i )
16+
mark[j] = 1;
17+
}
18+
}
19+
}
20+
21+
int main()
22+
{
23+
long long i,x;
24+
solv();
25+
while(cin>>x)
26+
{
27+
for(i=4;i<=x-4;i++){
28+
if(mark[i]==1 && mark[x-i]==1)
29+
{
30+
cout<<i<<" "<<x-i<<endl;
31+
break;
32+
}
33+
}
34+
}
35+
return 0;
36+
}

0 commit comments

Comments
 (0)