They were struck by hunger, so the Messenger of Allah ﷺ gave each of them a single date.
حدثنا أبو حفص عمرو بن علي حدثنا محمد بن جعفر حدثنا شعبة عن عباس الجريري قال سمعت أبا عثمان النهدي يحدث
أنه أصابهم جوع فأعطاهم رسول الله ﷺ تمرة تمرة
No references are available.
[Its chain of transmission is sahih]. Bukhari also narrated it in the Book of Foods, the chapter on what the Prophet ﷺ and his companions used to eat, hadith no. 5411, from the hadith of Abbas bin Faruq Jareeri, with the wording, "So he gave every person seven dates," meaning that he first gave them one date each, then gave each one six more dates, so it became seven dates for each person. And Allah knows best.