I am watching the anime right now and can't understand this part of the plot: there were two notebooks out of which one had been returned to the Shinigami that came to Ryuk to get his notebook back. That leaves one which was with T as he was doing Kira's killings. Now suddenly that notebook reaches Light Yagami and his team locked in a safe. How did that happen?
There were 4 Deathnotes in the real world. Ryuk has 2, Rem has 1 and another of Rem's friend who died to save Misa. Rem gave that Notebook to Misa.
At the beginning of the story, Ryuk gives his additional notebook to Light. Meanwhile after L's death Light got another notebook which was Rem's since Rem also died.
Mello stole one of the Notebooks for which the shinigami came and is supposedly the one originally dropped by Ryuk to be picked up by Light. This still leaves Rem's notebook in Light's possesion and Misa's with her.
TL;DR Humans in the series use 3 Notebooks. Sidoh's orginal which he took back. Jealous's original which Rem gave to Misa and Rem's Notebook which Light picked up after he/she disintegrated.