IB 782 then IB 2296 at Madrid
Berlin → Madrid → Melilla
Timetable, Madrid time
14:50IB 782 from Berlin at the gatealso VY 5083, AA 8506
12:35IB 2296 to Melilla leaves the gatealso VY 5696
21 h 45 apart on the timetable, overnight
IB 2296 leaves 21 h 45 after IB 782 arrives on the timetable: more than half a day, so not a connection we count.