Problem:
Score: 100 points

Problem Statement

There is a train going from Station A to Station B that costs X yen (the currency of Japan).

Also, there is a bus going from Station B to Station C that costs Y yen.

Joisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.

How much does it cost to travel from Station A to Station C if she uses this ticket?

Constraints

1 \leq X,Y \leq 100

Y is an even number.

All values in input are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

If it costs x yen to travel from Station A to Station C, print x.

Sample Input 1

81 58

Sample Output 1

110

The train fare is 81 yen.

The train fare is 58 ⁄ 2=29 yen with the 50% discount.

Thus, it costs 110 yen to travel from Station A to Station C.

Sample Input 2

4 54

Sample Output 2

31

Solution in Rust (1.15.1) (judge verdict: Accepted)

#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(unknown_lints)]
#![allow(unused_variables)]
#![allow(unused_must_use)]
#![allow(unused_mut)]
#![allow(dead_code)]
#![allow(unused_assignments)]

use std::cmp;
use std::process::{
    exit,
    Command
};
use std::fs::OpenOptions;
use std::collections::{
    HashMap,
    VecDeque
};
use std::io::{
    stdin,
    stdout,
    stderr,
    Read,
    Write,
    BufReader,
    BufWriter
};

macro_rules! d {
    ($t:expr, $($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", $t, $e).unwrap()
        })*
    };
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

macro_rules! e {
    ($($arg:tt)*) => {
        #[cfg(debug_assertions)]
        {
            let mut err = stderr();
            let e = format!($($arg)*);
            write!(err, "\x1B[32m{}\x1B[0m", e).unwrap()
        }
    };
}

macro_rules! eln {
    ($($arg:tt)*) => {
        #[cfg(debug_assertions)]
        {
            let mut err = stderr();
            let e = format!($($arg)*);
            writeln!(err, "\x1B[32m{}\x1B[0m", e).unwrap()
        }
    };
}

macro_rules! stdin {
    () => ({
        use std::io::Read;
        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    })
}

macro_rules! test {
    (name = $name:ident, $($input:expr => $output:expr),* $(,)*) => (
        #[test]
        fn $name() {
            $(
                assert_eq!(solve($input.to_string()), $output);
            )*
        }
    );
    ($($input:expr => $output:expr),* $(,)*) => (
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input.to_string()), $output);
            )*
        }
    );
}

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

pub trait VecUtils<T: Clone> {
    fn npop(&mut self, n: usize) -> Result<Vec<T>, String>;
    fn nget(&self, n: usize) -> Result<Vec<T>, String>;
    fn is_valid_range(&self, idx_a: usize, idx_b: usize) -> bool;
    fn get_range(&self, idx_a: usize, idx_b: usize) -> Result<Vec<T>, String>;
    fn pop_range(&mut self, idx_a: usize, idx_b: usize) -> Result<Vec<T>, String>;
    fn mul(&self, n: usize) -> Vec<T>;
}

pub trait StrUtils {
    fn npop(&mut self, n: usize) -> Result<String, String>;
    fn nget(&self, n: usize) -> Result<String, String>;
    fn is_valid_range(&self, idx_a: usize, idx_b: usize) -> bool;
    fn get_range(&self, idx_a: usize, idx_b: usize) -> Result<String, String>;
    fn pop_range(&mut self, idx_a: usize, idx_b: usize) -> Result<String, String>;
    fn mul(&self, n: usize) -> String;
}

impl<T: Clone> VecUtils<T> for Vec<T> {
    fn npop(&mut self, n: usize) -> Result<Vec<T>, String> {
        let len = self.len();
        if n > len {
            return Err("too large num".to_string());
        }
        let mut res: Vec<T> = Vec::new();
        for _ in 0..n {
            let x = self.pop().ok_or("".to_string())?;
            res.push(x);
        }
        res.reverse();
        Ok(res)
    }

    fn nget(&self, n: usize) -> Result<Vec<T>, String> {
        let len = self.len();
        if n > len {
            return Err("too large num".to_string());
        }
        let mut res: Vec<T> = Vec::new();
        for i in 0..n {
            res.push(self[len - 1 - i].clone());
        }
        Ok(res)
    }

    fn is_valid_range(&self, idx_a: usize, idx_b: usize) -> bool {
        let mut can = true;
        let self_len = self.len();
        if self_len < idx_a {
            can = false;
        }
        if self_len < idx_b {
            can = false;
        }
        can
    }

    fn get_range(&self, idx_a: usize, idx_b: usize) -> Result<Vec<T>, String> {
        if ! self.is_valid_range(idx_a, idx_b) {
            return Err("invalid range".to_string());
        }
        let mut res: Vec<T> = Vec::new();
        for (i,x) in self.into_iter().enumerate() {
            let i = i;
            if i < idx_a {
                continue;
            }
            if idx_b <= i {
                break;
            }
            res.push(x.clone());
        }
        Ok(res)
    }

    fn pop_range(&mut self, idx_a: usize, idx_b: usize) -> Result<Vec<T>, String> {
        if ! self.is_valid_range(idx_a, idx_b) {
            return Err("invalid range".to_string());
        }
        let mut res: Vec<T> = Vec::new();
        let mut pop_idxs: Vec<usize> = Vec::new();
        for (i,x) in self.iter().enumerate() {
            let i = i;
            if i < idx_a {
                continue;
            }
            if idx_b <= i {
                break;
            }
            res.push(x.clone());
            pop_idxs.push(i);
        }
        for _ in 0..pop_idxs.len() {
            match pop_idxs.pop() {
                Some(idx) => {
                    self.remove(idx as usize);
                },
                None => {}
            }
        }
        Ok(res)
    }

    fn mul(&self, n: usize) -> Vec<T> {
        let mut res: Vec<T> = Vec::new();
        for _ in 0..n {
            for x in self {
                res.push(x.clone());
            }
        }
        res
    }
}

impl StrUtils for String {
    fn npop(&mut self, n: usize) -> Result<String, String> {
        let mut self_chars: Vec<char> = self.chars().collect();
        match self_chars.npop(n) {
            Ok(poped) => {
                *self = self_chars.into_iter().collect::<String>();
                Ok(poped.into_iter().collect::<String>())
            },
            Err(e) => {
                Err(e)
            }
        }
    }
    fn nget(&self, n: usize) -> Result<String, String> {
        let self_chars: Vec<char> = self.chars().collect();
        match self_chars.nget(n) {
            Ok(v) => {
                Ok(v.into_iter().collect::<String>())
            },
            Err(e) => {
                Err(e)
            }
        }
    }
    fn is_valid_range(&self, idx_a: usize, idx_b: usize) -> bool {
        let self_chars: Vec<char> = self.chars().collect();
        self_chars.is_valid_range(idx_a, idx_b)
    }
    fn get_range(&self, idx_a: usize, idx_b: usize) -> Result<String, String> {
        let self_chars: Vec<char> = self.chars().collect();
        match self_chars.get_range(idx_a, idx_b) {
            Ok(v) => {
                Ok(v.into_iter().collect::<String>())
            },
            Err(e) => {
                Err(e)
            }
        }
    }
    fn pop_range(&mut self, idx_a: usize, idx_b: usize) -> Result<String, String> {
        let mut self_chars: Vec<char> = self.chars().collect();
        match self_chars.pop_range(idx_a, idx_b) {
            Ok(poped) => {
                *self = self_chars.into_iter().collect::<String>();
                Ok(poped.into_iter().collect::<String>())
            },
            Err(e) => {
                Err(e)
            }
        }
    }
    fn mul(&self, n: usize) -> String {
        let mut res: String = String::new();
        for _ in 0..n {
            res.push_str(self);
        }
        res
    }
}

fn main() {
    print!("{}", solve(stdin!()));
}



fn solve(src: String) -> String {
    let mut res = String::from("");
    input! {
        source = src,
        x: usize,
        y: usize
    }

    eln!("#####################################################");
    d!(x);
    d!(y);
    eln!("-----------------------------------------------------");

    let ans = x + y / 2;
    let str: &str = &ans.to_string();
    res.push_str(str);

    res.push_str("\n");
    d!(res);

    res
}


test! {
r"81 58
"
=>
r"110
"
,
r"4 54
"
=>
r"31
"
}