fn programming_education() -> Result<String, &'static str> {                                                                                                                  
    let mut input = String::new();                                                                                                                                            
    std::io::stdin().read_line(&mut input)                                                                                                                                    
        .map_err(|e| "input N error.")?;                                                                                                                                      
    let n : i32 = input.trim_right().parse()                                                                                                                                  
        .map_err(|e| "parse N error.")?;                                                                                                                                      
                                                                                                                                                                              
    if n == 1 {                                                                                                                                                               
        Ok(String::from("Hello World"))                                                                                                                                       
    }                                                                                                                                                                         
    else {                                                                                                                                                                    
        let mut input = String::new();                                                                                                                                        
        std::io::stdin().read_line(&mut input)                                                                                                                                
            .map_err(|e| "input A error.")?;                                                                                                                                  
        let a : i32 = input.trim_right().parse()                                                                                                                              
            .map_err(|e| "parse A error.")?;                                                                                                                                  
        let mut input = String::new();                                                                                                                                        
        std::io::stdin().read_line(&mut input)                                                                                                                                
            .map_err(|e| "input B error")?;                                                                                                                                   
        let b : i32 = input.trim_right().parse()                                                                                                                              
            .map_err(|e| "parse B error.")?;                                                                                                                                  
                                                                                                                                                                              
        Ok(format!("{}", a + b))                                                                                                                                              
    }                                                                                                                                                                         
}

fn main() {
    println!("{}", programming_education().unwrap());
}


Measured memory_bytes: 4352