Respectively means each in the order already given. Two lists, matched up one to one.
It sits at the end of the sentence and it only works when both sequences are in the same order, so saying that Ali and Sam came first and second respectively is clear and reversing either list breaks it. It is formal and appears constantly in reports and captions. The word is worth keeping apart from respectfully, which means with respect and is a completely different thing.
1adverbrespectivelyIn the order already mentioned.
“The two rooms sleep four and two respectively.”
Latin
respectus
Medieval Latin
respectivus
English
respective
English, today
respectively
From respective + -ly. respective Borrowed from Medieval Latin respectivus, from Latin respectus. by surface analysis, en + respect + ive.
Etymology from Wiktionary, CC BY-SA