Let the length of the train be L m.
Let the length of the platform be l m.
Speed of the train (V) = 24 km/h = 24 * 5/18 = 20/3 m/s
Speed of the man (v) = 8 km/h = 8 * 5/18 = 20/9 m/s
The train takes 8 seconds to pass the man.
So, t = L/(V - v)
8 = L/(20/3 - 20/9)
L = 320/9
L = 35.55 m = 36 m (approximately)
So, length of the train = 36 m
Now, the train takes 12 seconds to cross the platform.
So, t = (L + l)/V
12 = (320/9 + l)/(20/3)
l = 400/9
l = 44.44 m = 44 m (approximately)
So, the length of the platform is 45 m and that of the train is 36 m.