Один момент, сейчас всё исправлю:

fn time_to_fry_buns(n: i32) -> i32 {
    let time_per_side = 2; // 1 minute per side
    let buns_per_skillet = 2;
    let total_time = (n / buns_per_skillet) * time_per_side + (n % buns_per_skillet) * time_per_side;
    total_time
}

fn main() {
    let num_buns = 8;
    let total_time = time_to_fry_buns(num_buns);
    println!("It will take {} minutes to fry {} buns.", total_time, num_buns);
}
Вот твой алгоритм. Пользуйся и обращайся за помощью :)
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence