Problem Link /* explanation lets solve the problem only for 2 chicken. s[i] = speed of chicken i pos[i] = position of chicken i if s[i] > s[i - 1] then no problem, just check whether both can reach b within time or not. if s[i] < s[i - 1] then there is a chance that i can slow down i - 1. lets say s[i] = 1 m/sec and s[i - 1] = 2 m/sec and time limit is T and point to reach is B. for s[i] pos[i] can be at max B - T. if pos is greater than B-T it can not reach within Tsec. and for s[i - 1] pos[i - 1] can be at max (B-T)*2. if pos[i - 1] > (B-T)*2 it can not reach within Tsec. at T sec i will be at B and i - 1 will also be at B. at T - 1 i will be at B-T-1 and i-1 will be at B-T-2 and so on. as we can see i -1 will always be behind i. so there will not be any collision. if i is pos[i] < B-T then i can reach B before T sec ...