use std::env;

fn main() {
    let args: Vec<_> = env::args().collect();

    let (lower, upper, count) = match args.len() {
        1 => (0, u32::MAX, 1),
        2 => (0, args[1].parse().unwrap(), 1),
        3 => (args[1].parse().unwrap(), args[2].parse().unwrap(), 1),
        4 => (
            args[1].parse().unwrap(),
            args[2].parse().unwrap(),
            args[3].parse::<usize>().unwrap(),
        ),
        _ => panic!("Incorrect usage"),
    };

    assert!(lower < upper);

    for _ in 0..count {
        let value: u32 = rand::random();
        let res =
            (((value as u64) * (upper - lower) as u64) / u32::MAX as u64 + lower as u64) as u32;

        println!("{}", res);
    }
}
