Buggy python submission (verdict: Runtime Error):
number = int(input())

input_str = input().split()
temp = int(input_str[0])
goal = int(input_str[1])

Hn = list(map(int, input().split()))

avg_temp = [(temp - (Hn * 0.006)) / goal for Hn in Hn]

if goal >= 0:
    print(int((avg_temp.index(max(avg_temp))) + 1))
else:
    print(int((avg_temp.index(min(avg_temp))) + 1))



Fixed submission:
def main(n, t, a, h):
    def formula(t, x): return t - x * 0.006
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

    print(res.index(min(res)) + 1)


if __name__ == "__main__":
    n = int(input())
    t, a = map(int, input().split(' '))
    h = list(map(int, input().split(' ')))

    main(n, t, a, h)

Buggy python submission (verdict: Runtime Error):
input_str = input().split("\n")
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [(temp - (Hn * 0.006)) / goal for Hn in Hn]

if goal >= 0:
    print(int((avg_temp.index(max(avg_temp))) + 1))
else:
    print(int((avg_temp.index(min(avg_temp))) + 1))

Fixed submission:
def main(n, t, a, h):
    def formula(t, x): return t - x * 0.006
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

    print(res.index(min(res)) + 1)


if __name__ == "__main__":
    n = int(input())
    t, a = map(int, input().split(' '))
    h = list(map(int, input().split(' ')))

    main(n, t, a, h)

Buggy python submission (verdict: Runtime Error):
# avg_temp = temp - x * 0.006

input_str = input().split("\n")
# a = [int(x) for x in a]
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [(temp - (Hn * 0.006)) / goal for Hn in Hn]

if goal >= 0:
    print(int((avg_temp.index(max(avg_temp))) + 1))
else:
    print(int((avg_temp.index(min(avg_temp))) + 1))

Fixed submission:
def main(n, t, a, h):
    def formula(t, x): return t - x * 0.006
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

    print(res.index(min(res)) + 1)


if __name__ == "__main__":
    n = int(input())
    t, a = map(int, input().split(' '))
    h = list(map(int, input().split(' ')))

    main(n, t, a, h)

Buggy python submission (verdict: Runtime Error):
# avg_temp = temp - x * 0.006

input_str = input().split("\n")
# a = [int(x) for x in a]
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [(temp - (Hn * 0.006)) for Hn in Hn]

print(int((avg_temp.index(max(avg_temp))) + 1))


Fixed submission:
def main(n, t, a, h):
    def formula(t, x): return t - x * 0.006
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

    print(res.index(min(res)) + 1)


if __name__ == "__main__":
    n = int(input())
    t, a = map(int, input().split(' '))
    h = list(map(int, input().split(' ')))

    main(n, t, a, h)

Buggy python submission (verdict: Runtime Error):
input_str = input().split("\n")
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [int(temp - (Hn * 0.006)) for Hn in Hn]

print(int((avg_temp.index(max(avg_temp)))+1))


Fixed submission:
def main(n, t, a, h):
    def formula(t, x): return t - x * 0.006
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

    print(res.index(min(res)) + 1)


if __name__ == "__main__":
    n = int(input())
    t, a = map(int, input().split(' '))
    h = list(map(int, input().split(' ')))

    main(n, t, a, h)

Buggy python submission (verdict: Runtime Error):
input_str = input().split("\n")
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [int(temp - (Hn * 0.006)) for Hn in Hn]

print(int((avg_temp.index(max(avg_temp)))+1))


Fixed submission:
def main(n, t, a, h):
    def formula(t, x): return t - x * 0.006
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

    print(res.index(min(res)) + 1)


if __name__ == "__main__":
    n = int(input())
    t, a = map(int, input().split(' '))
    h = list(map(int, input().split(' ')))

    main(n, t, a, h)