Problem: Contest Page | CodeChef
DIFFICULTY:
EASY.
PROBLEM:
The chef is trying to solve some series problems, Chef wants your help to code it. Chef has one number N. Help the chef to find N’th number in the series.
2, 6, 12, 20, 30……
Program:
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
while(t--){
long long n;
cin>>n;
cout<<(n*n+n)<<"\n";
}
}