-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem28.cpp
More file actions
59 lines (53 loc) · 1.24 KB
/
Problem28.cpp
File metadata and controls
59 lines (53 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
Name: Krishna Mohan
Date: 3/21/2015
Algorithm:
Site:
Contest:
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<string> vs;
typedef vector<pi> vpi;
// Basic macros
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define ini(a, v) memset(a, v, sizeof(a))
#define re(i,s,n) for(int i=s;i<(n);++i)
#define rep(i,s,n) for(int i=s;i<=(n);++i)
#define fo(i,n) re(i,0,n)
#define rev(i,n,s) for(int i=(n)-1;i>=s;--i)
#define repv(i,n,s) for(int i=(n);i>=s;--i)
#define fov(i,n) rev(i,n,0)
#define pb push_back
#define mp make_pair
#define si(x) (int)(x.size())
#define MAX 100
#define INF 1000000007
#define MOD 1000000007
const double PI = acos(-1.0);
const int inf = 0x3f3f3f3f;
const double eps = 1e-15;
int main()
{
ios_base::sync_with_stdio(0);
int n=1001, lim=2*(n/2);
int st=1, sum=1;
for(int i=2;i<=lim;i+=2)
{
for(int j=0;j<4;j++)
{
st+=i;
sum+=st;
cout<<st<<" ";
}
cout<<endl;
}
cout<<"Sum: "<<sum<<endl;
return 0;
}