アルゴリズムと数学 084

https://atcoder.jp/contests/math-and-algorithm/tasks/panasonic2020_c

 a + b \ge cならNoです。
そうでないとき二乗して、
 a + 2\sqrt{ab} + b \lt c
 2\sqrt{ab} \lt c - a - b
 4ab \lt (c-a-b)^2
これが成り立つかを計算します。

// Sqrt Inequality
#![allow(non_snake_case)]


//////////////////// library ////////////////////

fn read<T: std::str::FromStr>() -> T {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).ok();
    line.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
            .map(|e| e.parse().ok().unwrap()).collect()
}

fn YesNo(b: bool) -> String {
    return if b { "Yes".to_string() } else { "No".to_string() }
}


//////////////////// process ////////////////////

fn read_input() -> (i64, i64, i64) {
    let v = read_vec();
    let a = v[0];
    let b = v[1];
    let c = v[2];
    (a, b, c)
}

fn f(a: i64, b: i64, c: i64) -> bool {
    if a + b >= c {
        false
    }
    else {
        4*a*b < (c-a-b).pow(2)
    }
}

fn main() {
    let (a, b, c) = read_input();
    println!("{}", YesNo(f(a, b, c)))
}