From 4b11cb5bd9e298cb07b466e507624a03875133eb Mon Sep 17 00:00:00 2001 From: ayushshivani <32260760+ayushshivani@users.noreply.github.com> Date: Sun, 29 Oct 2017 23:36:56 +0530 Subject: [PATCH 1/2] Add files via upload --- c.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 c.c diff --git a/c.c b/c.c new file mode 100644 index 0000000..0ac0267 --- /dev/null +++ b/c.c @@ -0,0 +1,30 @@ +#include +int main() +{ +int i,j,k; +int ar[12345]; +int N,Q; +int a,b,c; +if(scanf("%d %d",&N,&Q)){}; + +for(a=0;a Date: Sun, 29 Oct 2017 23:39:30 +0530 Subject: [PATCH 2/2] Add files via upload --- i2.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 i2.c diff --git a/i2.c b/i2.c new file mode 100644 index 0000000..218e0b9 --- /dev/null +++ b/i2.c @@ -0,0 +1,40 @@ + +#include +long long int sum[1000001]; +int main() +{ + long long int pri[1000001]; + long long int i,j,m,n; + long long int a; + int T; + for(i=0;i<1000001;i++) + { + pri[i]=1; + } + pri[0]=0;pri[1]=0; + for(i=2;i<1000001;i++) + { + if(pri[i]==1) + { + for(j=i;j*i<1000001;j++) + pri[i*j]=0; + } + } + for(i=2;i<1000001;i++) + { + if(pri[i]==1) + pri[i]=i; + } + + for(i=0;i<1000001;i++) + sum[i]=sum[i-1]+pri[i]; + + if(scanf("%d",&T)){}; + for(i=0;i