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# (.NET Core 3.1.201) (judge verdict: Accepted)

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;


namespace atc
{

    class Program
    {
        static T Read<T>()
        {
            Func<string, T> convFunc = null;
            if (typeof(T) == typeof(int)) convFunc = (_) => { return (T)(object)(int.Parse(_)); };
            else if (typeof(T) == typeof(Int16)) convFunc = (_) => { return (T)(object)(Int16.Parse(_)); };
            else if (typeof(T) == typeof(UInt16)) convFunc = (_) => { return (T)(object)(UInt16.Parse(_)); };
            else if (typeof(T) == typeof(Int32)) convFunc = (_) => { return (T)(object)(Int32.Parse(_)); };
            else if (typeof(T) == typeof(UInt32)) convFunc = (_) => { return (T)(object)(UInt32.Parse(_)); };
            else if (typeof(T) == typeof(Int64)) convFunc = (_) => { return (T)(object)(Int64.Parse(_)); };
            else if (typeof(T) == typeof(UInt64)) convFunc = (_) => { return (T)(object)(UInt64.Parse(_)); };
            else if (typeof(T) == typeof(float)) convFunc = (_) => { return (T)(object)(float.Parse(_)); };
            else if (typeof(T) == typeof(double)) convFunc = (_) => { return (T)(object)(double.Parse(_)); };
            return convFunc(Console.ReadLine());
        }

        static List<T> ReadVec<T>()
        {
            Func<string, T> convFunc = null;
            if (typeof(T) == typeof(int)) convFunc = (_) => { return (T)(object)(int.Parse(_)); };
            else if (typeof(T) == typeof(Int16)) convFunc = (_) => { return (T)(object)(Int16.Parse(_)); };
            else if (typeof(T) == typeof(UInt16)) convFunc = (_) => { return (T)(object)(UInt16.Parse(_)); };
            else if (typeof(T) == typeof(Int32)) convFunc = (_) => { return (T)(object)(Int32.Parse(_)); };
            else if (typeof(T) == typeof(UInt32)) convFunc = (_) => { return (T)(object)(UInt32.Parse(_)); };
            else if (typeof(T) == typeof(Int64)) convFunc = (_) => { return (T)(object)(Int64.Parse(_)); };
            else if (typeof(T) == typeof(UInt64)) convFunc = (_) => { return (T)(object)(UInt64.Parse(_)); };
            else if (typeof(T) == typeof(float)) convFunc = (_) => { return (T)(object)(float.Parse(_)); };
            else if (typeof(T) == typeof(double)) convFunc = (_) => { return (T)(object)(double.Parse(_)); };
            return Console.ReadLine().Split(' ').Select(s => (T)convFunc(s)).ToList();
        }

        static void Main(string[] args)
        {
            var l = Read<Int16>();
            Console.WriteLine(l + l*l + l*l*l);
        }
    }
}