Toggle navigation
YouTube
Facebook
Telegram
english
english
українська
Algotester 4.3
Build 496
2024-10-17
Log In
Contact Us
College
Sponsors
Donate
Sources
C++ 17
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long ans = 0; for (int m = 0; m <= n; m++) ans += 3LL * m * (m + 1) / 2; cout << ans << "\n"; return 0; }