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: Runtime Error)

using System;
using static System.Console;
using static System.Math;
using System.Numerics;
using System.Collections.Generic;


namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var s = ReadLine().Split(' ');
            long n, m, k;
            n = long.Parse(s[0]);
            m = long.Parse(s[1]);
            k = long.Parse(s[2]);
            var a = ReadLine().Split(' ');
            var b = ReadLine().Split(' ');
            long[] A = new long[n];
            long[] B = new long[m];
            for (int i = 0; i < n; i++)
            {
                A[i] = long.Parse(a[i]);
            }
            for (int i = 0; i < m; i++)
            {
                B[i] = long.Parse(b[i]);
            }
            long count = 0;
            long mCount = 0;

            long aCount;


            aCount = maxCount(A, k);
            long c = 0;
            for (long i = 0; i < aCount; i++)
            {
                c += A[i];
                long K = k - c;
                long bCount = -1;
                while (K > 0)
                {
                    bCount++;
                    K -= B[bCount];
                    if (bCount == B.Length)
                    {
                        break;
                    }
                }
                count = i + bCount;
                if (count > mCount)
                { mCount = count; }

            }


            WriteLine(mCount);
            Out.Flush();
        }

        public static long maxCount(long[] array, long max)
        {
            long time = 0;
            long resut = 0;
            long num = array.Length;
            bool a = true;
            for (long i = 0; i > num; i++)
            {
                time += array[i];
                if (time == max)
                {
                    resut = i + 1;
                    a = false;
                    break;
                }
                if (time > max)
                {
                    resut = i;
                    a = false;
                    break;
                }
            }
            if (a == true)
            { resut = num; }
            return resut;
        }

    }

}