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 JavaScript (Node.js 12.16.1) (judge verdict: Wrong Answer)

function Main(input) {

    input = input.split("\n");
    card = input[0].split(" ");
	
    let red = parseInt(card[0]);
    let green = parseInt(card[1]);
    let blue = parseInt(card[2]);

    const k = parseInt(input[1]);
    let i = 0;

    if (k == 1) {
        for( let x=0; x < 3 ; x++){
            card[x] = card[x] * 2;

            if(card[0]<card[1] && card[1]<card[2]) {
                i = 1;
                break;
            }

            card[0] = red;
            card[1] = green;
            card[2] = blue;
        }
        if(i==1) {
            console.log("Yes");
        } else {
            console.log("No");
        }
    } else if(k == 2){
        for( let x=0; x < 3 ; x++){
            for (let y=0; y < 3 ; y++){
                card[x] = card[x] * 2;
                card[y] = card[y] * 2;

                if(card[0]<card[1] && card[1]<card[2]) {
                    i = 1;
                    break;
                }

                card[0] = red;
                card[1] = green;
                card[2] = blue;
            }
        }
        if(i==1) {
            console.log("Yes");
        } else {
            console.log("No");
        }

    } else if (k == 3){
        for ( let x=0; x < 3 ; x++){
            for ( let y=0; y < 3 ; y++) {
                for ( let z=0; z < 3 ; z++) {
                    card[x] = card[x] * 2;
                    card[y] = card[y] * 2;
                    card[z] = card[z] * 2;

                    if(card[0]<card[1] && card[1]<card[2]) {
                        i = 1;
                        break;
                    }

                    card[0] = red;
                    card[1] = green;
                    card[2] = blue;
                }
            }
        }
        if(i==1) {
            console.log("Yes");
        } else {
            console.log("No");
        }
    } else if (k == 4){
        for ( let x=0; x < 3 ; x++){
            for ( let y=0; y < 3 ; y++) {
                for ( let z=0; z < 3 ; z++) {
                    for (let s=0; s < 3 ; s++){
                        card[x] = card[x] * 2;
                        card[y] = card[y] * 2;
                        card[z] = card[z] * 2;
                        card[s] = card[s] * 2;
    
                        if(card[0]<card[1] && card[1]<card[2]) {
                            i = 1;
                            break;
                        }

                        card[0] = red;
                        card[1] = green;
                        card[2] = blue;
                    
                    }
                }
            }
        }
        if(i==1) {
            console.log("Yes");
        } else {
            console.log("No");
        }
    } else if (k == 5){
        for ( let x=0; x < 3 ; x++){
            for ( let y=0; y < 3 ; y++) {
                for ( let z=0; z < 3 ; z++) {
                    for (let s=0; s < 3 ; s++){
                        for (let t=0; t<3 ; t++){
                            card[x] = card[x] * 2;
                            card[y] = card[y] * 2;
                            card[z] = card[z] * 2;
                            card[s] = card[s] * 2;
                            card[t] = card[s] * 2;
        
                            if(card[0]<card[1] && card[1]<card[2]) {
                                i = 1;
                                break;
                            }

                            card[0] = red;
                            card[1] = green;
                            card[2] = blue;
                        }
                    }
                }
            }
        }
        if(i==1) {
            console.log("Yes");
        } else {
            console.log("No");
        }
    } else if (k==6){
        for ( let x=0; x < 3 ; x++){
            for ( let y=0; y < 3 ; y++) {
                for ( let z=0; z < 3 ; z++) {
                    for (let s=0; s < 3 ; s++){
                        for (let t=0; t<3 ; t++){
                            for (let u=0; u<3 ; u++){
                                card[x] = card[x] * 2;
                                card[y] = card[y] * 2;
                                card[z] = card[z] * 2;
                                card[s] = card[s] * 2;
                                card[t] = card[s] * 2;
                                card[u] = card[u] * 2;
            
                                if(card[0]<card[1] && card[1]<card[2]) {
                                    i = 1;
                                    break;
                                }

                                card[0] = red;
                                card[1] = green;
                                card[2] = blue;
                            }
                            
                        }
                    
                    }
                }
            }
        }
        if(i==1) {
            console.log("Yes");
        } else {
            console.log("No");
        }
    } else if (k==7){
        for ( let x=0; x < 3 ; x++){
            for ( let y=0; y < 3 ; y++) {
                for ( let z=0; z < 3 ; z++) {
                    for (let s=0; s < 3 ; s++){
                        for (let t=0; t<3 ; t++){
                            for (let u=0; u<3 ; u++){
                                for (let v=0; v<3 ;v++){

                                    card[x] = card[x] * 2;
                                    card[y] = card[y] * 2;
                                    card[z] = card[z] * 2;
                                    card[s] = card[s] * 2;
                                    card[t] = card[s] * 2;
                                    card[u] = card[u] * 2;
                                    card[v] = card[v] * 2;
                
                                    if(card[0]<card[1] && card[1]<card[2]) {
                                        i = 1;
                                        break;
                                    }

                                    card[0] = red;
                                    card[1] = green;
                                    card[2] = blue;
                                }

                            }
                            
                        }
                    
                    }
                }
            }
        }
        if(i==1) {
            console.log("Yes");
        } else {
            console.log("No");
        }
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));