I did not understand how to take input

did not understand hoe ta take input libnked list first i think use a loop then use insertatatail but i got stuck will u plzz code it and gave me a sample

Refer to this solution to know how to get the input https://ide.codingblocks.com/s/257371

https://ide.codingblocks.com/s/257412 its giving right output why it is not clearinga all the test cases