diff --git a/solutions/rust/src/bin/577A.rs b/solutions/rust/src/bin/577A.rs new file mode 100644 index 0000000..0e6c8de --- /dev/null +++ b/solutions/rust/src/bin/577A.rs @@ -0,0 +1,21 @@ +use std::io; + +fn main() { + let mut s = String::new(); + io::stdin().read_line(&mut s).unwrap(); + + let a: Vec = s.split_whitespace().map(|d| d.parse::().unwrap()).collect(); + + let n = a[0]; + let x = a[1]; + + let mut count = 0; + for i in 1..=(n.trunc() as u64) { + let pos = x / (i as f64); + if pos.fract() == 0. && pos <= n { + count += 1 + } + } + + println!("{}", count); +}