Failed = 25% = 1 unit; passed = 75% = 3 units. Passed has 2 units more than failed, and that gap is 16.
Plain numbers are given; italic underlined numbers are worked out.
8 pupils failed the test.
Check: passed 24 − failed 8 = 16. ✓