Merge K sorted arrays - Heaps

Problem - https://hack.codingblocks.com/contests/c/537/886
My code-https://ide.codingblocks.com/s/74873

Second test failing … please help