Created
July 25, 2019 23:34
-
-
Save surinoel/e914576faf14aed8b8610b37f58d514e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| #include <iostream> | |
| using namespace std; | |
| int main(void) { | |
| ios_base::sync_with_stdio(false); | |
| cin.tie(nullptr); | |
| long long n; | |
| cin >> n; | |
| long long sum = 0; | |
| for (int i = 1; i < n; i++) { | |
| sum += i * n + i; | |
| } | |
| cout << sum << '\n'; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment