AtCoder Beginner Contest 172 - Calc

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-----
2

-----Sample Output-----
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.

Source: atcoder | Difficulty: EASY


Solutions:
a = int(input())
b = int(a ** 2)
c = int(a ** 3)
print(a + b + c)


x = int(input())
print(x + x * x + x * x * x)


a = int(input())
print(int(a ** 3 + a ** 2 + a))


a = int(input())
a = a + a * a + a * a * a
print(a)


a = int(input())
print(int(a * ((a + 1) ** 2 - a)))


import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp
INF = inf
MOD = 1000000007
a = int(input())
tmp = 0
res = 0
res = a + a ** 2 + a ** 3
print(res)


val = int(input())
print(val + val * val + val * val * val)


n = int(input())
print(n + n * n + n * n * n)


s = int(input())
print(s + s ** 2 + s ** 3)


n = int(input())
print(n + n ** 3 + n ** 2)


a = int(input())
print(a * (a * a + a + 1))


a = int(input())
n = a + a * a + a * a * a
print(n)


a = int(input())
A = a + a * a + a * a * a
print(int(A))


n = int(input())
print(n * (n * n + n + 1))


N = int(input())
print(N + N ** 2 + N ** 3)


a = int(input())
G = a + a * a + a * a * a
print(G)


x = int(input())
print(x + x ** 2 + x ** 3)


n = int(input())
print(format(n + n * n + n * n * n))


a = int(input())
print(a - ~a * a ** 2)


x = input()
X = int(x)
y = X + X ** 2 + X ** 3
print(y)


N = int(input().strip())
print(N + N * N + N * N * N)


a = int(input())
print(str(a + a * a + a * a * a))


A = int(input())
C = A * A
D = C * A
print(A + C + D)


n = int(input())
b = n + n * n + n * n * n
print(b)


a = int(input())
ans = a + a ** 2 + a * a ** 2
print(ans)


a = int(input())
ans = a + a * a + a * a * a
print(ans)


I = int(input())
print(I + I ** 2 + I ** 3)


d = int(input())
print(d + d ** 2 + d ** 3)


a = int(input())
b = a * a * a + a * a + a
print(int(b))


a = int(input())
s = a + a * a + a * a * a
print(int(s))


n = int(input())
r = n + n * n + n * n * n
print(r)


S = int(input())
W = S + S ** 2 + S ** 3
print(W)


a = int(input())
print(round(a * a * a + a * a + a))


k = int(input())
print(k + k * k + k * k * k)


a = int(input(''))
b = a * a
c = a * a * a
print(a + b + c)


M = int(input())
print(M + M ** 3 + M ** 2)


print((lambda x: x + x * x + x * x * x)(int(input())))


a = int(input().strip())
print(a + a * a + a * a * a)


s = int(input())
N = s + s * s + s * s * s
print(N)


a = int(input().rstrip())
print(a * (1 + a * (1 + a)))


a = int(input())
x = a + a * a + a * a * a
print(x)


X = int(input())
print(X + X ** 2 + X ** 3)


i = int(input())
print(i + i ** 2 + i ** 3)


N = int(input())
print(N + N * N + N ** 3)


N = int(input())
print(N + N * N + N * N * N)


temp = int(input())
print(temp + temp ** 2 + temp ** 3)


t = int(input())
print(t + t ** 2 + t ** 3)


A = int(input())
print(A + A ** 2 + A ** 3)


int = int(input())
print(int + int ** 2 + int ** 3)


import math
import itertools
import collections
import bisect
import heapq

def IN():
	return int(input())

def sIN():
	return input()

def MAP():
	return map(int, input().split())

def LMAP():
	return list(map(int, input().split()))

def TATE(n):
	return [input() for i in range(n)]
MOD = 10 ** 9 + 7
a = IN()
print(a + a ** 2 + a ** 3)


a = int(input(''))
s = a ** 2
t = a ** 3
print(a + s + t)


a = int(input())
ans = 0
for i in range(1, 4):
	ans += a ** i
print(ans)


a = int(input())
total = a + a * a + a * a * a
print(total)


def main():
	a = int(input())
	print(int(a + a ** 2 + a ** 3))
	return

def __starting_point():
	main()
__starting_point()


k = int(input())
print(int(k + k ** 2 + k ** 3))


a = int(input())
su = a + a * a + a * a * a
print(su)


a = int(input())
z = a + a * a + a * a * a
print(z)


n = int(input())
n1 = n ** 2
n2 = n ** 3
print(n + n1 + n2)


num = int(input())
answer = num + num ** 2 + num ** 3
print(answer)


A = int(input())
print(A + A * A + A * A * A)


i = int(input())
print(i * (1 + i * (1 + i)))


a = int(input())
print(a + a * a + a ** 3)


n = int(input())
p = n + n * n + n * n * n
print(p)


n = int(input())
print(n + n ** 2 + n ** 2 * n)


a = int(input())
r = a + a * a + a ** 3
print(r)


i = int(input())
print(i + i * i + i * i * i)


n = int(input())
print(n * (1 + n + n ** 2))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, bisect
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
import sys
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
stdin = sys.stdin
ni = lambda : int(ns())
nf = lambda : float(ns())
na = lambda : list(map(int, stdin.readline().split()))
nb = lambda : list(map(float, stdin.readline().split()))
ns = lambda : stdin.readline().rstrip()
a = ni()
print(a + a ** 2 + a ** 3)


num = int(input())
a = num * num
b = num * a
print(num + a + b)