The first two questions were a bit of cake-walk , but i found out many people had wrong submissions on the second question.

well the common observation that missed in the first question was the elevator started from the ground to top and then back to ground, hence taking twice of time . so simple time=distance/velocity will suffice here. here is the solution link http://ide.geeksforgeeks.org/sPhhTt

Moreover in the second question, it was a simple maths problem ,where you can simple check if |b-a|==n/2 (IF N IS EVEN)then it lies on the diameter ,hence the answer will be always 0, read in lower classes that any triangle drawn with diameter as the base will be 90 at the circumference. BUT many people thot that A<B and the most common part that was missed was that if k is ODD it will have no diameters.

if the points do not form a diameter then , for example if i take k as 11 and A as 2 and B as 7 then there are two parts one which has(3,4,5,6) and the other has (8,9,10,11,1) hence the part with the lower value will be your answer since the part with higher values will form acute angles (basic maths).

Some basic maths will get you the formulae.

here is the solution link https://www.codechef.com/viewsolution/15058202

i hope this helps the people(beginners) who have just started coding.