Saturday, 2 June 2012

UVa 913 Joana and the Odd Numbers Solution

#include<iostream>
#include<string>
#include<cstring>
#include<sstream>
#include<cctype>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<stack>
#include<fstream>
#include<cstdlib>
#include<iomanip>
#include<vector>
#include<map>
using namespace std;

int main()
{
unsigned long long x;
while(cin>>x)
    {
    cout<<3*((((x+1)*(x+1))/2)-3)<<endl;
    }
return 0;
}

No comments:

Post a Comment