https://atcoder.jp/contests/abc246/tasks/abc246_b
最初からf64にすれば楽ですね。
// Get Closer #![allow(non_snake_case)] use itertools::Itertools; use std::collections::HashSet; 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 main() { let v = read_vec(); let A: f64 = v[0]; let B: f64 = v[1]; let dist = (A * A + B * B).sqrt(); println!("{} {}", A / dist, B / dist) }