“Élèves” is masculine plural, so we need to match both forms accordingly.
In the first blank, it is followed by a noun, so we use the adjective form: Quels.
Quels élèves veulent manger ? (Which students want to eat?)
In the second blank, the noun is omitted — we are asking “which ones,” so we use the pronoun: Lesquels.
Lesquels veulent partir ? (Which ones want to leave?)
Final sentence: Quels élèves veulent manger et lesquels veulent partir ?