Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main() {
- unsigned long long int n, total, ans;
- cin >> n;
- if(n == 0) cout << 1 << "\n";
- else {
- total = ( n * ( n + 1 ) ) / 2;
- ans = (( 6 * total ) + 1 );
- cout << ans << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement