fuadnafiz98

problem solution

Jan 25th, 2021
709
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.   unsigned long long int n, total, ans;
  7.   cin >> n;
  8.   if(n == 0) cout << 1 << "\n";
  9.   else {
  10.     total = ( n * ( n + 1 ) ) / 2;
  11.     ans = (( 6 * total ) + 1 );
  12.     cout << ans << "\n";
  13.   }
  14. }
  15.  
RAW Paste Data