مَا لِزَيْدٍ وَعَمْرٍو؟
Translation: What is the matter with Zayd and Amr?
مَا: interrogative pronoun functioning as the topic (nominative position).
لِزَيْدٍ: preposition lām and genitive Zayd; phrase functioning as the predicate.
وَ: conjunction.
عَمْرٍو: coordinated with genitive Zayd, and therefore genitive.
The written final wāw in ʿAmr is an orthographic distinction, not the case marker; the grammatical case here is genitive with kasra.