Find the weighted median of n elements, with O(n) worst case time complexity.
input: n
output: generated list of elements, and their weighted median
Use dynamic programming to solve this problem. Input and output are in files.
Input and output are in files.