Problem: Takahashi and Aoki will have a battle using their monsters.  The health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.  The two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ... Here, an attack decreases the opponent's health by the value equal to the attacker's strength. The monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.  If Takahashi will win, print `Yes`; if he will lose, print `No`.

Submission attempts (in order):
inputs = input().split(' ')

d = inputs[0:2]
takahashi = {'Name': 'Takahashi', 'Hp': int(d[0]), 'Power': d[1]}
d = inputs[2:4]
aoki = {'Name': 'Aoki', 'Hp': int(d[0]), 'Power': d[1]}

players = [aoki, takahashi]
N =len(players)
while True:
    for i in range(N):
        players[i-1]['HP'] -= players[i]['Power']
        if players[i-1]['HP'] <= 0:
            if players[i]['Name'] == 'Takahashi':
                print('Yes')
            else:
                print('No')

# B

inputs = input().split(' ')

d = inputs[0:2]
takahashi = {'Name': 'Takahashi', 'Hp': int(d[0]), 'Power': d[1]}
d = inputs[2:4]
aoki = {'Name': 'Aoki', 'Hp': int(d[0]), 'Power': d[1]}

players = [aoki, takahashi]
N =len(players)
while True:
    for i in range(N):
        players[i-1]['Hp'] -= players[i]['Power']
        if players[i-1]['Hp'] <= 0:
            if players[i]['Name'] == 'Takahashi':
                print('Yes')
            else:
                print('No')

# B

inputs = input().split(' ')

d = inputs[0:2]
takahashi = {'Name': 'Takahashi', 'Hp': int(d[0]), 'Power': int(d[1])}
d = inputs[2:4]
aoki = {'Name': 'Aoki', 'Hp': int(d[0]), 'Power': int(d[1])}

players = [aoki, takahashi]
N =len(players)

loop = True
while True:
    for i in range(N):
        players[i-1]['Hp'] -= players[i]['Power']
        if players[i-1]['Hp'] <= 0:
            if players[i]['Name'] == 'Takahashi':
                print('Yes')
            else:
                print('No')
            loop = False
            break

# B

inputs = input().split(' ')

d = inputs[0:2]
takahashi = {'Name': 'Takahashi', 'Hp': int(d[0]), 'Power': int(d[1])}
d = inputs[2:4]
aoki = {'Name': 'Aoki', 'Hp': int(d[0]), 'Power': int(d[1])}

players = [aoki, takahashi]
N =len(players)
while True:
    for i in range(N):
        players[i-1]['Hp'] -= players[i]['Power']
        if players[i-1]['Hp'] <= 0:
            if players[i]['Name'] == 'Takahashi':
                print('Yes')
            else:
                print('No')

# B

inputs = input().split(' ')

d = inputs[0:2]
takahashi = {'Name': 'Takahashi', 'Hp': int(d[0]), 'Power': int(d[1])}
d = inputs[2:4]
aoki = {'Name': 'Aoki', 'Hp': int(d[0]), 'Power': int(d[1])}

players = [takahashi, aoki]

def compute(players):
    N =len(players)
    while True:
        for i in range(N):
            players[i-1]['Hp'] -= players[i]['Power']
            if players[i-1]['Hp'] <= 0:
                if players[i]['Name'] == 'Takahashi':
                    print('Yes')
                else:
                    print('No')
                return 

compute(players)

Verdicts: Runtime Error

Runtime Error

Time Limit Exceeded

Time Limit Exceeded

Accepted