Problem:
Score : 100 points

Problem Statement

Given is an integer r.

How many times is the area of a circle of radius r larger than the area of a circle of radius 1?

It can be proved that the answer is always an integer under the constraints given.

Constraints

1 \leq r \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

r

Output

Print the area of a circle of radius r, divided by the area of a circle of radius 1, as an integer.

Sample Input 1

2

Sample Output 1

4

The area of a circle of radius 2 is 4 times larger than the area of a circle of radius 1.

Note that output must be an integer - for example, 4.0 will not be accepted.

Sample Input 2

100

Sample Output 2

10000

Solution in Rust (1.15.1) (judge verdict: Runtime Error)

use std::cmp;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
  }

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
  }

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
    // 3
    // 1 2
    // 1 3
    // 1 4
    // のようなタイプ
    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    }};
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
  }

fn main() {
    input! {
        x: u64,
        y: u64
    }

    let total = x + y;

    if total % 3 != 0 {
        println!("0");
    } else {
        // +1,+2の移動をa +2,+1の移動をbとする
        // a + 2b = X
        // 2a + b = Y

        // 2Y - X = 3a
        // a = ( 2Y -X ) / 3
        // b = ( 2X -Y ) / 3

        let a = (2 * y - x) / 3;
        let b = (2 * x - y) / 3;

        //println!("{} {}", a, b);

        if a < 0 || b < 0 {
            println!("0");
        } else {
            fn inverse_mod(element: u64, modulo: u64) -> u64 {
                // フェルマーの小定理からpが素数なら a^(p-1) = 1
                // よってa*a^(p-2) = 1 より a^(p-2)がaの逆元
                fn power(base: u64, exp: u64, modulo: u64) -> u64 {
                    if exp == 0 {
                        return 1;
                    }
                    if exp & 1 == 0 {
                        return (power(base, exp / 2, modulo) % modulo).pow(2) % modulo;
                    } else {
                        return power(base, exp - 1, modulo) % modulo * base % modulo;
                    }
                }
                power(element, modulo - 2, modulo) % modulo
            }
            fn combination_mod(m: u64, n: u64, modulo: u64) -> u64 {
                // m C n = m! / ( n! * (m - n)! )
                //       = m*(m-1)*(m-2)*...*(m-n+1)/n!
                //       = m*(m-1)*(m-2)*...*(m-n+1) * (n!)^-1
                let mut numerator = 1;
                for i in 0..n {
                    numerator *= (m - i);
                    numerator %= modulo;
                }
                // (m-n)!
                let mut element = 1;
                for j in 1..(n + 1) {
                    element *= j;
                    element %= modulo;
                }
                numerator * inverse_mod(element, modulo) % modulo
            }

            println!("{}", combination_mod(a + b, b, 1_000_000_007));
            // 大きい問題例でTLEになってしまう
        }
    }
}