merge median of two arrays into recursive folder