Problem:
Score: 200 points

Problem Statement

M-kun has the following three cards:

A red card with the integer A.

A green card with the integer B.

A blue card with the integer C.

He is a genius magician who can do the following operation at most K times:

Choose one of the three cards and multiply the written integer by 2.

His magic is successful if both of the following conditions are satisfied after the operations:

The integer on the green card is strictly greater than the integer on the red card.

The integer on the blue card is strictly greater than the integer on the green card.

Determine whether the magic can be successful.

Constraints

1 \leq A, B, C \leq 7

1 \leq K \leq 7

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B C
K

Output

If the magic can be successful, print Yes; otherwise, print No.

Sample Input 1

7 2 5
3

Sample Output 1

Yes

The magic will be successful if, for example, he does the following operations:

First, choose the blue card. The integers on the red, green, and blue cards are now 7, 2, and 10, respectively.

Second, choose the green card. The integers on the red, green, and blue cards are now 7, 4, and 10, respectively.

Third, choose the green card. The integers on the red, green, and blue cards are now 7, 8, and 10, respectively.

Sample Input 2

7 4 2
3

Sample Output 2

No

He has no way to succeed in the magic with at most three operations.

Solution in Rust (1.42.0) (judge verdict: Wrong Answer)

#![allow(unused_macros, unused_variables, dead_code, clippy::many_single_char_names)]
use std::io::{stdin, stdout, StdinLock, StdoutLock, BufWriter, prelude::*};

macro_rules! read {
    ($s: ident) => {
        {
            $s.read()
        }
    };
    ($s: ident, $t: ty) => {
        {
            let mut v: $t = 0;
            let num = $s.read();
            let l = num.len();
            
            if num[0] == b'-' {
                for d in &num[1..l] {
                    v = v*10 - (*d as $t) + (b'0' as $t);
                }
            } else {
                for d in &num[..l] {
                    v = v*10 + (*d as $t) - (b'0' as $t);
                }
            }
            v
        }
    }
}

macro_rules! to_str {
    ($v: expr) => {
        {
            let mut s = String::new();
            for x in $v {
                s.push(*x as char);
            }
            s
        }
    };
    ($v: expr, $l: expr) => {
        {
            let mut s = String::with_capacity($l);
            for x in $v {
                s.push(*x as char);
            }
            s
        }
    }
}

macro_rules! to_vec {
    ($v: expr) => {
        {
            let mut s = Vec::new();
            for x in $v {
                s.push(*x as char);
            }
            s
        }
    };
    ($v: expr, $l: expr) => {
        {
            let mut s = Vec::with_capacity($l);
            for x in $v {
                s.push(*x as char);
            }
            s
        }
    }
}

macro_rules! read_vec {
    ($s: ident, $l: expr) => {
        {
            let mut v = Vec::with_capacity($l);
            for _ in 0..$l {
                v.push(to_str!(read!($s)));
            }
            v
        }
    };
    ($s: ident, $t: ty, $l: expr) => { // for ints
        {
            let mut v = Vec::with_capacity($l);
            for _ in 0..$l {
                v.push(read!($s, $t));
            }
            v
        }
    };
}

macro_rules! void {
    ($s: ident, $l: expr) => {
        if $l > 0 {
            let mut n = 0;
            let mut first = true;

            while n < $l {
                if $s.pos != 0 {
                    $s.stdin.consume($s.pos);
                }

                let buf = $s.stdin.fill_buf().unwrap();

                let mut resume = true;

                for (i, x) in buf.iter().enumerate() {
                    if x == &b' ' || x == &b'\n' {
                        if i == 0 && first {
                            continue;
                        }

                        n += 1;

                        if n == $l {
                            $s.pos = i+1;
                            resume = false;
                            break;
                        }
                    }
                }

                if resume {
                    $s.pos = buf.len();
                    first = false;
                }
            }
        }
    };
}

macro_rules! pipe {
    // ($s: ident, $($x: ident),*) => {
    //     $(
    //         $x = read!($s);
    //     )*
    // };
    ($s: ident, $t: ty, $($x: ident),*) => {
        $(
            $x = read!($s, $t);
        )*
    };
    ($s: ident, $( ($x: ident, $t: ty) ),*) => {
        $(
            $x = read!($s, $t);
        )*
    };
}

struct Reader<'a> {
    stdin: StdinLock<'a>,
    pos: usize,
    v_temp: Vec<u8>
}

impl<'a> Reader<'a> {
    fn new(stdin: StdinLock<'a>)/*'*/ -> Self {
        Reader {stdin, pos: 0, v_temp: vec![]}
    }
    
    fn read(&mut self) -> &[u8] {
        if self.pos != 0 {
            self.stdin.consume(self.pos);
        }
        let mut s = 0;
        let mut i = 0;
        
        let buf = self.stdin.fill_buf().unwrap();
        
        loop {
            if unsafe {buf.get_unchecked(i)} < &33 {
                if i > buf.len() {
                    let b_len = buf.len();
                    let mut idx_char = 0;
                    
                    loop {
                        if unsafe {buf.get_unchecked(idx_char)} > &33 || idx_char == b_len {
                            break;
                        }
                        idx_char += 1;
                    }
                    let mut v1;
                    if b_len != idx_char {
                        v1 = vec![0; b_len-idx_char];
                        v1[..].copy_from_slice(&buf[idx_char..]);
                    } else {
                        v1 = vec![];
                    }

                    let new_buf = {
                        self.stdin.consume(b_len);
                        let buf = self.stdin.fill_buf().unwrap();
                        let mut i = 0;

                        loop {
                            if unsafe {buf.get_unchecked(i)} < &33 {
                                break if i == 0 {
                                    &[]
                                } else {
                                    &buf[..=i]
                                }
                            }
                            i += 1;
                        }
                    };
                    if !new_buf.is_empty() {
                        self.pos = new_buf.len();
                        v1.extend(new_buf.iter());
                    } else {
                        self.pos = 0;
                    }

                    self.v_temp = v1;

                    return &self.v_temp[..];
                } else if s == i {
                    s += 1;
                } else {
                    break;
                }
            }
            i += 1;
        }
        self.pos = i+1;

        if s == i {
            self.read()
        } else {
            &self.stdin.fill_buf().unwrap()[s..i]
        }
    }
}

fn main() {
    let stdin = stdin();
    let stdout = stdout();
    solve(&mut Reader::new(stdin.lock()), &mut BufWriter::new(stdout.lock()));
}

fn msb(n: u16) -> u16 {
    let mut i = 0;
    let mut n = n;
    while n!=0 {
        n >>= 1;
        i += 1;
    }
    i
}

fn solve(r: &mut Reader, w: &mut BufWriter<StdoutLock>) {
    let (a, mut b, mut c, k);
    pipe!(r, u16, a, b, c, k);

    let mut val = 0;
    if a > b {
        let mut i = 0;

        val += loop {
            if b <= a {
                i += 1;
                b <<= 1;
            }
            else {
                break i;
            }
        };
    }
    if b > c {
        let mut i = 0;

        val += loop {
            if c <= b {
                i += 1;
                c <<= 1;
            } else {
                break i;
            }
        }
    }
    if k >= val {
        write!(w, "Yes");
    } else {
        write!(w, "No");
    }
}