Problem:
Score : 100 points

Problem Statement

It is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.

Given an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.

Constraints

1 \leq r \leq 100

r is an integer.

Input

Input is given from Standard Input in the following format:

r

Output

Print an integer representing the area of the regular dodecagon.

Sample Input 1

4

Sample Output 1

48

The area of the regular dodecagon is 3 \times 4^2 = 48.

Sample Input 2

15

Sample Output 2

675

Sample Input 3

80

Sample Output 3

19200

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

use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;

#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let n: usize = read_as_vec()[0];
    let a: Vec<i32> = read_as_vec();
    
    //if status[i] == true, we put a ball into ith box
    let mut status: Vec<bool> = vec![false;n];

    for i in (0..n).rev(){
        //println!("i = {}, a[i] = {}", i, a[i]);
        let mut sum = 0;
        for j in i+1..n{
            if (j+1)%(i+1) == 0 && status[j]{
                sum += 1;
            }
        }
        
        if (sum%2 == 0 && a[i] == 1) || (sum%2 == 1 && a[i] == 0){
            status[i] = true;
        }
        //println!("{:?}", status);
    }
    let num_balls = status.iter().filter(|x| **x == true).count();
    println!("{}", num_balls);
    
    if num_balls == 0{
        return;
    }
    
    for (i, is_ball) in status.iter().enumerate(){
        if *is_ball{
            print!("{} ", i+1);
        }
    }
    println!("");
}