Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
from math import gcd
import itertools

def main():
    k = int(input())
    ans = 0
    num = [i for i in range(1,k+1)]
    comb = tuple(itertools.product(num, repeat=3))

    for i in comb:
        ans += gcd(gcd(i[0], i[1]), i[2])

    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
#coding:utf-8
from math import gcd

def main():
    k = int(input())
    ans = 0

    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(gcd(a, b), c)

    print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
import itertools
from functools import reduce

def gcd(num):
    return reduce(math.gcd, num)

def main():
    k = int(input())
    ans = 0

    num = [i for i in range(1,k+1)]
    comb = tuple(itertools.product(num, repeat=3))


    for i in comb:
        ans += gcd(i)

    print(ans)

if __name__ == "__main__":
    main()



Fixed submission:
#coding:utf-8
from math import gcd

def main():
    k = int(input())
    ans = 0

    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(gcd(a, b), c)

    print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
import itertools
from functools import reduce

def gcd(num):
    return reduce(math.gcd, num)

def main():
    k = int(input())
    ans = 0

    num = [i for i in range(1,k+1)]
    comb = tuple(itertools.product(num, repeat=3))


    for i in comb:
        ans += gcd(i)

    print(ans)

if __name__ == "__main__":
    main()



Fixed submission:
#coding:utf-8
from math import gcd

def main():
    k = int(input())
    ans = 0

    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(gcd(a, b), c)

    print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
import itertools
from functools import reduce

def gcd(num):
    return reduce(math.gcd, num)


if __name__ == "__main__":

    k = int(input())
    ans = 0

    num = list(range(1, k+1))
    comb = tuple(itertools.product(num, repeat=3))


    for i in range(len(comb)):
        ans += gcd(comb[i])

    print(ans)


Fixed submission:
#coding:utf-8
from math import gcd

def main():
    k = int(input())
    ans = 0

    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(gcd(a, b), c)

    print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
import itertools
from functools import reduce

def gcd(num):
    return reduce(math.gcd, num)


if __name__ == "__main__":

    k = int(input())
    ans = 0

    num = list(range(1, k+1))
    comb = list(itertools.product(num, repeat=3))


    for i in range(len(comb)):
        ans += gcd(comb[i])

    print(ans)


Fixed submission:
#coding:utf-8
from math import gcd

def main():
    k = int(input())
    ans = 0

    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(gcd(a, b), c)

    print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
import itertools
from functools import reduce

def gcd(*num):
    return reduce(math.gcd, num)


if __name__ == "__main__":

    k = int(input())
    ans = 0

    num = list(range(1, k+1))
    comb = list(itertools.product(num, repeat=3))


    for i in range(len(comb)):
        ans += gcd(comb[i][0], comb[i][1], comb[i][2])

    print(ans)


Fixed submission:
#coding:utf-8
from math import gcd

def main():
    k = int(input())
    ans = 0

    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(gcd(a, b), c)

    print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
import itertools
from functools import reduce

def gcd(*num):
    return reduce(math.gcd, num)


if __name__ == "__main__":

    k = int(input())
    ans = 0

    num = list(range(1, k+1))
    comb = list(itertools.product(num, repeat=3))


    for i in range(len(comb)):
        ans += gcd(comb[i][0], comb[i][1], comb[i][2])

    print(ans)


Fixed submission:
#coding:utf-8
from math import gcd

def main():
    k = int(input())
    ans = 0

    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(gcd(a, b), c)

    print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
import math
from functools import reduce

def gcd(*num):
    return reduce(math.gcd, num)


if __name__ == "__main__":

    k = int(input())
    ans = 0
    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(a, b, c)

    print(ans)


Fixed submission:
#coding:utf-8
from math import gcd

def main():
    k = int(input())
    ans = 0

    for a in range(1, k+1):
        for b in range(1, k+1):
            for c in range(1, k+1):
                ans += gcd(gcd(a, b), c)

    print(ans)

if __name__ == "__main__":
    main()