
import random

def split_and_merge(l, start, end, l2):
   if start >= end - 1:
      return;
   mid = int((start + end) / 2)
   split_and_merge(l2, start, mid, l)
   split_and_merge(l2, mid, end, l)
   i = start
   j = mid
   for k in range(start, end):
      if i < mid and (j >= end or l[i] <= l[j]):
         l2[k] = l[i]
         i += 1
      else:
         l2[k] = l[j]
         j += 1
      pass

for loop_times in range(0, 5):
   #while True:
   list1 = [random.randint(0,100) for _ in range(64)]
   list2 = list1.copy()
   print(list1)
   split_and_merge(list1, 0, len(list1), list2)
   print(list1)
   print()
