Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
print(x**3)


Fixed submission:
a=input()
print a**3

Buggy python submission (verdict: Runtime Error):
x=input()
print(x**3)


Fixed submission:
a=input()
print a**3

Buggy python submission (verdict: Runtime Error):
x=input()
print(str(x**3))


Fixed submission:
a=input()
print a**3

Buggy python submission (verdict: Runtime Error):
a=input()
print(a**3)


Fixed submission:
a=input()
print a**3
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()

print("{} {}".format(a*b,a**2+b**2))


Fixed submission:
a,b=[int(x) for x in input().split()]
print(a*b,2*a+2*b)

Buggy python submission (verdict: Runtime Error):
a,b=input()
 
print("{0} {1}".format(a*b,a**2+b**2))


Fixed submission:
a,b=[int(x) for x in input().split()]
print(a*b,2*a+2*b)

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
  
print('{0} {1}'.format(a*b,a**2+b**2))


Fixed submission:
a,b=[int(x) for x in input().split()]
print(a*b,2*a+2*b)
Buggy python submission (verdict: Runtime Error):
s=input()
 
m=s//60
h=m//60
s=s%60
 
print("{}:{}:{}".format(h,m,s))


Fixed submission:
s = int(input())

m = s // 60
h = m // 60
m = m % 60
s = s % 60

output=""
output+=str(h)
output+=":"
output+=str(m)
output+=":"
output+=str(s)

print(output)

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

m = s // 60
h = m // 60
s = s % 60

output=""
if(h!=0):
   output+=int(h)
output+=":"
if(m!=0):
   output+=int(m)
output+=":"
if(s!=0):
   output+=int(s)

print(output)



Fixed submission:
s = int(input())

m = s // 60
h = m // 60
m = m % 60
s = s % 60

output=""
output+=str(h)
output+=":"
output+=str(m)
output+=":"
output+=str(s)

print(output)
Buggy python submission (verdict: Runtime Error):
x = input()
print(x**3)


Fixed submission:
x = int(input())
print(x ** 3)

Buggy python submission (verdict: Runtime Error):
x = input()
print(x**3)



Fixed submission:
x = int(input())
print(x ** 3)

Buggy python submission (verdict: Runtime Error):
x = input()
print(x ** 3)



Fixed submission:
x = int(input())
print(x ** 3)

Buggy python submission (verdict: Runtime Error):
x = input()
cube = x ** 3
print(cube)



Fixed submission:
x = int(input())
print(x ** 3)

Buggy python submission (verdict: Runtime Error):
x = input()
cube = x * x * x
print(cube)



Fixed submission:
x = int(input())
print(x ** 3)
Buggy python submission (verdict: Runtime Error):
list = map(int(), input().split())
area = list[0] * list[1]
perimeter = list[0] * 2 + list[1] * 2
print(str(area) + " " + str(perimeter))


Fixed submission:
l = list(map(int, input().split()))
area = l[0] * l[1]
perimeter = l[0] * 2 + l[1] * 2
print('{0} {1}'.format(area, perimeter))

Buggy python submission (verdict: Runtime Error):
list = map(int(), input().split())
area = list[0] * list[1]
perimeter = list[0] * 2 + list[1] * 2
'{} {}'.format(area, perimeter)


Fixed submission:
l = list(map(int, input().split()))
area = l[0] * l[1]
perimeter = l[0] * 2 + l[1] * 2
print('{0} {1}'.format(area, perimeter))

Buggy python submission (verdict: Runtime Error):
list = map(int(), input().split())
area = list[0] * list[1]
perimeter = list[0] * 2 + list[1] * 2
print('%d %d' (area, perimeter))



Fixed submission:
l = list(map(int, input().split()))
area = l[0] * l[1]
perimeter = l[0] * 2 + l[1] * 2
print('{0} {1}'.format(area, perimeter))

Buggy python submission (verdict: Runtime Error):
list = map(int(), input().split())
area = list[0] * list[1]
perimeter = list[0] * 2 + list[1] * 2
print('{0} {1}.format(area, perimeter))



Fixed submission:
l = list(map(int, input().split()))
area = l[0] * l[1]
perimeter = l[0] * 2 + l[1] * 2
print('{0} {1}'.format(area, perimeter))

Buggy python submission (verdict: Runtime Error):
list = map(int(), input().split())
area = list[0] * list[1]
perimeter = list[0] * 2 + list[1] * 2
print(area)
print(perimeter)
# print('{0} {1}.format(area, perimeter))



Fixed submission:
l = list(map(int, input().split()))
area = l[0] * l[1]
perimeter = l[0] * 2 + l[1] * 2
print('{0} {1}'.format(area, perimeter))

Buggy python submission (verdict: Runtime Error):
list = map(int, input().split())
area = list[0] * list[1]
perimeter = list[0] * 2 + list[1] * 2
print(area)
print(perimeter)
# print('{0} {1}.format(area, perimeter))



Fixed submission:
l = list(map(int, input().split()))
area = l[0] * l[1]
perimeter = l[0] * 2 + l[1] * 2
print('{0} {1}'.format(area, perimeter))

Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
area = l[0] * l[1]
perimeter = l[0] * 2 + l[1] * 2
print('{0} {1}.format(area, perimeter))



Fixed submission:
l = list(map(int, input().split()))
area = l[0] * l[1]
perimeter = l[0] * 2 + l[1] * 2
print('{0} {1}'.format(area, perimeter))
Buggy python submission (verdict: Runtime Error):
input_s = int(input())
h = s / 3600
rest_s = s % 3600
m = rest_s / 60
s = rest_s % 60
print('{}:{}:{}'.format(h, m, s))



Fixed submission:
input_s = int(input())
h = input_s // 3600
rest_s = input_s % 3600
m = rest_s // 60
s = rest_s % 60
print('{}:{}:{}'.format(h, m, s))
Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
sorted_list = l.sorted()
print('{} {} {}'.format(l[0], l[1], l[2])



Fixed submission:
l = list(map(int, input().split()))
sorted_list = sorted(l)
print('{} {} {}'.format(sorted_list[0], sorted_list[1], sorted_list[2]))

Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
sorted_list = sorted(l)
print('{} {} {}'.format(l[0], l[1], l[2])



Fixed submission:
l = list(map(int, input().split()))
sorted_list = sorted(l)
print('{} {} {}'.format(sorted_list[0], sorted_list[1], sorted_list[2]))
Buggy python submission (verdict: Time Limit Exceeded):
import math

(a, b) = tuple([int(s) for s in input().split()])

min = a if a < b else b
divisor = 1

i = 2
while i <= min:
    if a % i == 0 and b % i == 0:
        a = a / i
        b = b / i
        divisor = divisor * i
    else:
        i = i + 1

print(divisor)

Fixed submission:
# 1_1_B

def gcd(x, y):
    while x%y != 0:
        x, y = y, x%y
    return y

x, y = map(int, input().split())
print(gcd(x, y))

Buggy python submission (verdict: Runtime Error):
import math

(a, b) = tuple([int(s) for s in input().split()])

if a==b:
    print(a)
    return

min = a if a < b else b
divisor = 1

i = 2
while i < math.sqrt(min):
    if a % i == 0 and b % i == 0:
        a = a / i
        b = b / i
        divisor = divisor * i
    else:
        i = i + 1

print(divisor)

Fixed submission:
# 1_1_B

def gcd(x, y):
    while x%y != 0:
        x, y = y, x%y
    return y

x, y = map(int, input().split())
print(gcd(x, y))
Buggy python submission (verdict: Time Limit Exceeded):
import math

def is_prime(num):
    i = 2
    while i < math.sqrt(num):
        if num % i == 0:
            return False
    return True

N = int(input())
cnt = 0
for i in range(0, N):
    n = int(input())
    if (is_prime(n)):
        cnt = cnt + 1
        
        
print(cnt)

Fixed submission:
def is_prime(num):
    i = 2
    while i*i <= num:
        if num % i == 0:
            return False
        i = i + 1
    return True

N = int(input())
cnt = 0
for i in range(0, N):
    n = int(input())
    if (is_prime(n)):
        cnt = cnt + 1
        
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = input()
print(N*N*N)

Fixed submission:
N = int(input())
print(N*N*N)

Buggy python submission (verdict: Runtime Error):
N = input()
print(N*N*N)

Fixed submission:
N = int(input())
print(N*N*N)

Buggy python submission (verdict: Runtime Error):
N = input()
N = N*N*N
print(N)

Fixed submission:
N = int(input())
print(N*N*N)
Buggy python submission (verdict: Runtime Error):
a = [int(item) for item in input().split()]

print(2*(a[0]+a[1]) + " " + a[0]*a[1])

Fixed submission:
a = [int(item) for item in input().split()]
print("{} {}".format(a[0]*a[1], 2*(a[0]+a[1])))
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

def main():
    nums = [int(n) for n in stdin]

    primes = list(filter(is_prime, nums))
    print(len(primes))

def is_prime(n):
    if 1 == n:
        return False

    if 2 == n:
        return True

    if 0 == n % 2:
        return False

    for i in range(3, n, 2):
        if 0 == n % i:
            return False

    return True

if __name__ == '__main__':
    main()

Fixed submission:
from math import sqrt

def is_prime(x):
    if x == 2:
        return 1

    if x % 2 == 0:
        return 0

    i = 3
    while i <= int(x/i):
        if x % i == 0:
            return 0
        i += 2

    return 1

def main():
    n = int(input())

    count = 0

    for _ in range(n):
        count += is_prime(int(input()))

    print(count)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())

    nums = []
    for i in range(n):
        nums.append(int(input()))

    r = max(nums[1:]) - nums[0]

    for i in range(1, n-1):
        ri = nums[i]

        if ri == rj:
            rj = max(nums[i+1:])

        r = max(r, rj-ri)

    print(r)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())

    r  = 0
    ri = 0

    for i in range(n):
        m = int(input())

        if 0 == i:
            ri = m
            continue

        if 1 == i:
            r = m - ri

        r  = max(r, m - ri)
        ri = min(ri, m)

    print(r)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())

    nums = []
    for i in range(n):
        nums.append(int(input()))

    r = max(nums[1:]) - nums[0]

    for i in range(1, n-1):
        ri = nums[i]

        if ri == rj:
            rj = max(nums[i+1:])

        r = max(r, rj-ri)

    print(r)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())

    r  = 0
    ri = 0

    for i in range(n):
        m = int(input())

        if 0 == i:
            ri = m
            continue

        if 1 == i:
            r = m - ri

        r  = max(r, m - ri)
        ri = min(ri, m)

    print(r)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def calcAreas(sections):
    areas = []

    for s in sections:
        if len(s) <= 1:
            continue;

        areas.append(toArea(s))

    return areas

def toArea(section):
    a = 0
    b, _ = section[0]

    for s, e in section:
        a += (max(s, e) - b) - (0.5 if s != e else 0)

    return int(a)

def toDelta(p):
    if '/' == p:
        return -1
    if '\\' == p:
        return 1
    return 0

def toPaths(path):
    h = 0
    ph = 0
    paths = []

    for p in path:
        h += toDelta(p)
        paths.append((ph,h))
        ph = h

    return paths

def update(sections):
    [(lf, ll)] = sections.pop()

    n = None

    for i in range(len(sections)-1, -1, -1):
        if sections[i][0][0] == ll:
            n = i
            break

    if n == None:
        sections.append([(lf, ll)])
        return

    lst = [(lf, ll)]
    for i in range(len(sections)-1, n-1, -1):
        s = sections.pop()
        lst = s + lst

    sections.append(lst)

def main():
    paths = toPaths(input())

    prev = -1
    sections = []

    for f, l in paths:
        sections.append([(f, l)])
        if l < prev:
            update(sections)
        prev = l

    areas = calcAreas(sections)
    l = len(areas)

    print(sum(areas))
    print(l, end='')
    if l > 0:
        print(' {}'.format(' '.join([str(x) for x in areas])), end='')
    print()

if __name__ == '__main__':
    main()



Fixed submission:
def calcAreas(sections):
    areas = []

    for s in sections:
        if len(s) <= 1:
            continue;

        areas.append(toArea(s))

    return areas

def toArea(section):
    a = 0
    b, _ = section[0]

    for s, e in section:
        a += (max(s, e) - b) - (0.5 if s != e else 0)

    return int(a)

def toDelta(p):
    if '/' == p:
        return -1
    if '\\' == p:
        return 1
    return 0

def toPaths(path):
    h = 0
    ph = 0
    paths = []

    for p in path:
        h += toDelta(p)
        paths.append((ph,h))
        ph = h

    return paths

def update(sections):
    [(lf, ll)] = sections.pop()

    n = None

    for i in range(len(sections)-1, -1, -1):
        if sections[i][0][0] == ll:
            n = i
            break

    if n == None:
        sections.append([(lf, ll)])
        return False

    lst = [(lf, ll)]
    for i in range(len(sections)-1, n-1, -1):
        s = sections.pop()
        lst = s + lst

    sections.append(lst)
    return True

def main():
    paths = toPaths(input())

    prev = -1
    sections = []

    prev_update = True

    for f, l in paths:
        sections.append([(f, l)])
        if l < prev:
            if prev_update:
                prev_update = update(sections)
        else:
            prev_update = True

        prev = l

    areas = calcAreas(sections)
    l = len(areas)

    print(sum(areas))
    print(l, end='')
    if l > 0:
        print(' {}'.format(' '.join([str(x) for x in areas])), end='')
    print()

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = raw_input()

print(int(n)**3)

Fixed submission:
x = int(input())
print(x**3)
Buggy python submission (verdict: Runtime Error):
def count_divisors(a, b, c):
    if a == b:
        return (1 if c % a == 0 else 0)

    return (1 if c % a == 0 else 0) + count_divisors(a+1, b, c)

a, b, c = map(int, input().split(' '))

print(count_divisors(a, b, c))

Fixed submission:
a, b, c = map(int, input().split())

count = 0

for i in range(a, b+1):
    if c % i == 0:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' '))

print("{} {} {:5f}".format(int(a/b), a%b, a/b))

Fixed submission:
import math

r = float(input())

print(math.pi*(r**2), 2*math.pi*r)
Buggy python submission (verdict: Runtime Error):
n, m, l = map(int, input().split(' '))

A = []
for i in range(n):
    A.append(list(map(int, input().split(' '))))

B = []
for i in range(m):
    B.append(list(map(int, input().split(' '))))

C = [[0 for i in range(n)] for j in range(l)]
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for c in C:
    print(' '.join([str(x) for x in c]))

Fixed submission:
n, m, l = map(int, input().split())

A = []
for _ in range(n):
    A.append(list(map(int, input().split())))

B = []
for _ in range(m):
    B.append(list(map(int, input().split())))

C = [ [ 0 for _ in range(l) ] for _ in range(n) ]
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k]*B[k][j]

for i in range(n):
    sep = ''
    for j in range(l):
        print(sep+str(C[i][j]), end='')
        sep = ' '
    print()
Buggy python submission (verdict: Time Limit Exceeded):
line = int(input())
nums = []
for n in range(line):
    nums.append(int(input()))

res = nums[1] - nums[0]
for i in range(line):
    for j in range(i+1, line):
        dif = nums[j] - nums[i]
        res = dif if dif > res else res

print(res)

Fixed submission:
line = int(input())
nums = []
for n in range(line):
    nums.append(int(input()))

# res = nums[1] - nums[0]
# for i in range(line):
#     for j in range(i+1, line):
#         dif = nums[j] - nums[i]
#         res = dif if dif > res else res
maxd = nums[1] - nums[0]
minv = nums[0]

for j in range(1, line):
    maxd = max(maxd, nums[j] - minv)
    minv = min(minv, nums[j])


print(maxd)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
S = [int(x) for x in input().split()]
q = int(input())
T = [int(x) for x in input().split()]


res = 0

for num in T:
    if num in S:
        res += 1

print(res)

Fixed submission:
len_a = input()
a = set(map(int, input().split()))
len_b = input()
b = set(map(int, input().split()))

print(len(a & b))
Buggy python submission (verdict: Time Limit Exceeded):
class Hash:
    def __init__(self):
        self.size = 1000000
        self.l = [0] * 1000000

    def insert_key(self, st):
        i = 0
        while True:
            j = self.h(st, i)
            if self.l[j] == 0:
                self.l[j] = st
                #print("inserted")
                return
            else:
                i = i+1

    def find_key(self, st):
        i = 0
        while True:
            j = self.h(st, i)
            if self.l[j] == st:
                return "yes"
            elif self.l[j] == 0 or (i >= self.size):
                return "no"
            else:
                i += 1

    def h1(self, key):
        return sum([ord(c) for c in key]) % self.size

    def h2(self, key):
        return 1 + sum([ord(c) for c in key]) % ( self.size - 1 )

    def h (self, key, i):
        return (self.h1(key) + i* self.h2(key)) % self.size

#main
n = int(input())
hash = Hash()

for _ in range(n):
    ope, st = input().split()
    if ope == "insert":
        hash.insert_key(st)
    elif ope == "find":
        print(hash.find_key(st))

Fixed submission:
dic ={}


n = int(input())

for _ in range(n):
    com, word = input().split()
    
    if com =="insert":
        dic[word] = True
    elif com =='find':
        print("yes" if word in dic else "no")

Buggy python submission (verdict: Time Limit Exceeded):
class Hash:
    def __init__(self):
        self.size = 1046527
        self.l = [0] * self.size

    def insert_key(self, st):
        i = 0
        while True:
            j = self.h(st, i)
            if self.l[j] == 0:
                self.l[j] = st
                #print("inserted")
                return
            else:
                i = i+1

    def find_key(self, st):
        i = 0
        while True:
            j = self.h(st, i)
            if self.l[j] == st:
                return "yes"
            elif self.l[j] == 0 or (i >= self.size):
                return "no"
            else:
                i += 1

    def h1(self, key):
        return sum([ord(c) for c in key]) % self.size

    def h2(self, key):
        return 1 + sum([ord(c) for c in key]) % ( self.size - 1 )

    def h (self, key, i):
        return (self.h1(key) + i* self.h2(key)) % self.size

#main
n = int(input())
hash = Hash()

for _ in range(n):
    ope, st = input().split()
    if ope == "insert":
        hash.insert_key(st)
    elif ope == "find":
        print(hash.find_key(st))

Fixed submission:
dic ={}


n = int(input())

for _ in range(n):
    com, word = input().split()
    
    if com =="insert":
        dic[word] = True
    elif com =='find':
        print("yes" if word in dic else "no")
Buggy python submission (verdict: Time Limit Exceeded):
def solve(i, m):
    if m == 0: return True
    if i >=n: return False
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res

n = int(input())
A = [int(x) for x in input().split()]
q = int(input())
M = [int(x) for x in input().split()]

for m in M:
    if solve(0, m):
        print("yes")
    else:
        print("no")

Fixed submission:
def power_set(item_lists):

    p_sets = [[]]

    for item in item_lists:
        tmp = []
        for element in p_sets:
            tmp.append(element + [item])
        p_sets.extend(tmp)

    return p_sets



if __name__ == "__main__":
    n = int(input())
    A = list(map(int, input().split()))
    q = int(input())
    m = list(map(int, input().split()))

    p_set = [sum(l) for l in power_set(A)]

    for m_i in m:

        if m_i in p_set:
            print("yes")
        else:
            print("no")
Buggy python submission (verdict: Runtime Error):
import math
def calc_distance(x1, y1, x2, y2):

    '''
    :param x1:(float)
    :param y1:(float)
    :param x2:(float)
    :param y2:(float)
    :return: (float) distance between two points
    '''

    return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)



if  __name__ == '__main__':
    x1, y1, x2, y2 = [int(x) for x in input().split(" ")]
    res = calc_distance(x1, y1, x2, y2)
    print(res)

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())

d = math.sqrt(((x2 - x1) ** 2 + (y2 - y1) ** 2))
print(d)

Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = [int(x) for x in input().split(" ")]

print( math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())

d = math.sqrt(((x2 - x1) ** 2 + (y2 - y1) ** 2))
print(d)

Buggy python submission (verdict: Runtime Error):
x1, y1, x2, y2 = [int(x) for x in input().split(" ")]

print( ( (x2 - x1) ** 2  +  (y2 - y1) ** 2 ) ** (1/2) )

Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())

d = math.sqrt(((x2 - x1) ** 2 + (y2 - y1) ** 2))
print(d)
Buggy python submission (verdict: Runtime Error):
pi = 3.14159265359
r = int(input())

print(f"{r*r*pi:.6f} {2*r*pi:.6f}")


Fixed submission:
import math
n = float(input())
area = "%.6f" % float(n **2 *  math.pi)
circ = "%.6f" % float(n * 2 * math.pi)
print(area, circ)

Buggy python submission (verdict: Runtime Error):
pi = 3.14159265359
r = int(input())

print(f"{r*r*pi:.6f} {2*r*pi:.6f}")


Fixed submission:
import math
n = float(input())
area = "%.6f" % float(n **2 *  math.pi)
circ = "%.6f" % float(n * 2 * math.pi)
print(area, circ)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
res = "%.6f" % float(n * math.pi)
print(res)

Fixed submission:
import math
n = float(input())
area = "%.6f" % float(n **2 *  math.pi)
circ = "%.6f" % float(n * 2 * math.pi)
print(area, circ)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
orig_n = n

res=[]
i = 2
while i <= (orig_n):
    if n % i == 0:
        n = n // i
        res.append(i)
        i = 1
    i += 1
print("{0}: {1}".format(orig_n, " ".join(map(str, res))))

Fixed submission:
n = int(input())
orig_n = n
res=[]
i = 2
half_n = n // 2
root_n = int(n ** (1/2))
is_prime = True
while i <= (root_n):
    if orig_n % i == 0:
        is_prime = False
        break
    i += 1
if is_prime: res.append(orig_n)

while i <= half_n and not(is_prime):
    if n ==1:
        break
    if n % i == 0:
        n = n // i
        res.append(i)
        i = 1
    i += 1

print("{0}: {1}".format(orig_n, " ".join(map(str, res))))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
orig_n = n

res=[]
i = 2
while i <= (orig_n // 2):
    if n % i == 0:
        n = n // i
        res.append(i)
        i = 1
    i += 1
if len(res) == 0 : res.append(orig_n)
print("{0}: {1}".format(orig_n, " ".join(map(str, res))))

Fixed submission:
n = int(input())
orig_n = n
res=[]
i = 2
half_n = n // 2
root_n = int(n ** (1/2))
is_prime = True
while i <= (root_n):
    if orig_n % i == 0:
        is_prime = False
        break
    i += 1
if is_prime: res.append(orig_n)

while i <= half_n and not(is_prime):
    if n ==1:
        break
    if n % i == 0:
        n = n // i
        res.append(i)
        i = 1
    i += 1

print("{0}: {1}".format(orig_n, " ".join(map(str, res))))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
orig_n = n
res=[]
i = 2
half_n = n // 2
root_n = int(n ** (1/2))
is_prime = True
while i <= (root_n):
    if orig_n % i == 0:
        is_prime = False
        break

while i <= half_n and not(is_prime):
    if n ==1:
        break
    if n % i == 0:
        n = n // i
        res.append(i)
        i = 1
    i += 1

print("{0}: {1}".format(orig_n, " ".join(map(str, res))))

Fixed submission:
n = int(input())
orig_n = n
res=[]
i = 2
half_n = n // 2
root_n = int(n ** (1/2))
is_prime = True
while i <= (root_n):
    if orig_n % i == 0:
        is_prime = False
        break
    i += 1
if is_prime: res.append(orig_n)

while i <= half_n and not(is_prime):
    if n ==1:
        break
    if n % i == 0:
        n = n // i
        res.append(i)
        i = 1
    i += 1

print("{0}: {1}".format(orig_n, " ".join(map(str, res))))