fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int n, res,a1=2,d=2;
  5. cin >>n;
  6. res=((2*a1+d*(n-1))/2)*n;
  7. cout << (res+1);
  8. return 0;
  9. }
Success #stdin #stdout 0s 15232KB
stdin
1
stdout
3