Problem:
Score : 100 points

Problem Statement

Given an integer a as input, print the value a + a^2 + a^3.

Constraints

1 \leq a \leq 10

a is an integer.

Input

Input is given from Standard Input in the following format:

a

Output

Print the value a + a^2 + a^3 as an integer.

Sample Input 1

2

Sample Output 1

14

When a = 2, we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14.

Print the answer as an input. Outputs such as 14.0 will be judged as incorrect.

Sample Input 2

10

Sample Output 2

1110

Solution in C++ (GCC 9.2.1) (judge verdict: Wrong Answer)

#pragma warning(disable:4996)

#include<iostream>
#include<algorithm>
//#include<unordered_map>
#include<fstream>
#include<iomanip>
#include<string>
#include<cmath>
#include<cstring>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<stack>
#include<sstream>
#include<cstdio>
#include<ctime>
#include<cstdlib>
#define INF 0x3f3f3f3f
#define inf 0x7FFFFFFF
#define MOD 1000000007
#define pii pair<ll,ll>
#define eps 1e-8
#define equals(a,b) (fabs(a-b)<eps)
#define bug puts("bug")
#define re  register
#define fi first
#define se second
const int maxn = 1e7 + 5;
const double Inf = 10000.0;
const double PI = acos(-1.0);
typedef  long long ll;
using namespace std;

ll a[305];
ll m, s;

int main() {
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) scanf("%lld", a + i);
	m = a[2];
	for (int i = 3; i < n; i++) m ^= a[i];
	s = a[0] + a[1];
	ll rem = s - m;
	if ((rem % 2) || (rem < 0)) {
		puts("-1");
		return 0;
	}
	rem /= 2;
	ll b = rem;
	int f = 1;
	for (ll i = 50; i >= 0; i--) {
		ll p = 1ll << i;
		if ((m & p) && (rem & p)) f = 0;
		if ((m & p) && ((b + p) <= a[0])) b += p;
	}
	b = a[0] - b;
	if ((b >= a[0]) || (b < 0)) f = 0;
	if (f) printf("%lld", b);
	else puts("-1");
}