Codeforces 268B. Buttons Solution
Solve in C++:
- ///**********ALLAH IS ALMIGHTY************///
- ///AH Tonmoy
- ///Department of CSE
- ///Islamic University,Bangladesh
- #include<iostream>
- using namespace std;
- int main()
- {
- long long n,s=0;
- cin>>n;
- for(int i=1; i<n; i++)
- {
- s=s+((n-i)*i);
- }
- cout<<s+n<<endl;
- }
No comments