User Inputs in Merge K sorted Arrays

In this Merge K sorted Arrays Question, how to take inputs from user.
for eg…
user enters k=3;
so 3 arrays should be taken as input from user;
the size of each array is unknown.
How to take inputs in this case

@arnav.dawer hey arnav you can take 2 dimensional array to take inputs

thanks
but since number of inputs in each array is unknown .so how to iterate?

@arnav.dawer you can use while(scanf("%d", array) != EOF)

EOF i guess would read till end of inputs.
but in my case i want that for inputs of array 1 to be stored in a[1]; array 2 in a[2] and so on.
like the inputs are
0 1 2 3 // array 1
4 8 9 6 4 5 //array 2
1 2 3 8 10 12 //array 3

now using the condition of ‘\n’ …ie… read till enter key is pressed doesnt store the arrays as desired

Please help

@arnav.dawer hey arnav you can use 2d array in this case or array of linked lists

Hey Arnav,
If your doubt is resolved, please mark it as resolved in your course’s “ Ask Doubt ” section.