Here is genesis 4:20-21
That is the line of Cain you are referring to and not the line of Seth whence Noah came.
The genealogy in Gen 5, however, includes the genealogy in Gen 4 with minor changes in order and spelling.
Thus Cainan=Cain, Mahalaleel=Mehujael, Jared=Irad, Enoch=Enoch, Methuselah=Methusael, Lamech =Lamech.
Therefore the first name (ie the adam) in the Gen 4 genealogy is the grandson of the first name listed in the Gen 5 genealogy.
Gen 4 says that three of Noah's brothers were Tubal-Cain, Jabal & Jubal and a sister's name was Naamah.
The bible clearly says that the particular flood which drowned most of Noah's family was only 15 cubits high and had no effect on a nearby olive tree from which Noah's pet bird plucked a leaf since it was growing outside the flooded area which stretched to the horizon.
And since Gen 4:20-21 says that Jabal was the father of all tent dwellers and Jubal was the father of all musicians, then obviously they were living outside the flooded area since they weren't drowned with their grandparents (Gen 5:27) and their widowed mother (Gen 5:31) and their aunts & uncles & cousins (Gen 5:26) and their other brothers & sisters & families (Gen 5:30) and Noah's other children & grandchildren born before and after Mrs Noah gave birth to triplets at aged 500 "years" old (Gen 5:32).
Hope that helps.