Skip to content

Commit 926ebfd

Browse files
codeforces problemset
1140D *dp *greedy *math
1 parent 1c165d3 commit 926ebfd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//Problem Link : https://codeforces.com/problemset/problem/1140/D
2+
3+
#include<bits/stdc++.h>
4+
using namespace std;
5+
typedef long long ll;
6+
int main()
7+
{
8+
ll n,w=0,i;
9+
cin>>n;
10+
for(i=3;i<=n;i++)
11+
w=w+(i*(i-1));
12+
cout<<w;
13+
return 0;
14+
}

0 commit comments

Comments
 (0)