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 Rust (1.42.0) (judge verdict: Accepted)

use proconio::input;

use std::io::Write;

pub trait Echo {
    fn echo(&self);
    fn echo_b(&self, out: &mut std::io::Stdout) -> Result<(), std::io::Error>;
}

macro_rules! impl_echo {
    ($($t:ty),*) => {
        $(
            impl Echo for $t {
                fn echo(&self){
                    self.echo_b(&mut std::io::stdout()).unwrap();
                }

                fn echo_b(&self, out: &mut std::io::Stdout) -> Result<(), std::io::Error>{
                    writeln!(out,"{}", &self)?;
                    Ok(())
                }
            }
        )*
    };
}

macro_rules! impl_echo_f {
    ($($t:ty),*) => {
        $(
            impl Echo for $t {
                fn echo(&self){
                    self.echo_b(&mut std::io::stdout()).unwrap();
                }

                fn echo_b(&self, out: &mut std::io::Stdout) -> Result<(), std::io::Error>{
                    writeln!(out,"{:.12}", &self)?;
                    Ok(())
                }
            }
        )*
    };
}

impl_echo!(u8, u16, u32, u64, u128, usize);
impl_echo!(i8, i16, i32, i64, i128, isize);
impl_echo!(&str, String, char);
impl_echo_f!(f32, f64);

impl<T: Echo> Echo for Vec<T> {
    fn echo(&self) {
        self.echo_b(&mut std::io::stdout()).unwrap();
    }
    fn echo_b(&self, out: &mut std::io::Stdout) -> Result<(), std::io::Error> {
        for i in self {
            i.echo_b(out).unwrap();
        }
        Ok(())
    }
}

fn main() {
    input! {
        a: u32
    };
    let res = a + a.pow(2) + a.pow(3);
    res.echo();
}