See this is same as combinatrics problem of a bot moving from (0,0) to (n,n) in either moving right or up,likewise here 10,30,40 and 175,150,120,90,70 should be in this order always before reaching 50
so no of ways= picking slots for 10,30,40 in 3ways among 8 places before reaching 50, making 8!/(3!*5!)=56