Merge k sorted arrays using stl

code is not working
logic is simple
input a

‘‘input b
c=a+b
a=c
input b
c=a+b’’
above loop goes for k times
my code