#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import random
r = np.random.randint(1000, size=15)
median = np.median(r)
#generate c++ code array

array_str = ""
for e in r[:-1]:
    array_str = array_str + "%d, "%e
array_str = array_str + "%d "% r[-1]  
print ("// code generated by median_test.py")    
print ("int array_len = %d;"% r.shape[0])
print ("float median = %f;" % median)
print ("int arr[%d] = { %s};"%( r.shape[0], array_str))
print ("// end of generated code") 
