First of all, you don't have to check if the input is correct, so the following lines are useless:
if(n>=1 && n<=100)
if(t>=1 && t<=100)
if(s>= 360 && s<=1200)
if(i==1) //this is wrong - I think the that the condition is i>=1
{
if(a[i] <= a[i-1]){
return 0;
}
}
Then, n has nothing to do with t. So temp=t/n is not ok. (try: 3 60 600 600 630 631 to see why).
Imagine that you have 4 points: A,B,C,D. The distance (in time) between them is as it follows: B-A=s ,C-B=t, D-C=sn. So two gondolas that have the same speed, would meet in the point (A+D)/2.
Also, you may want to check
http://www.cplusplus.com/reference/ios/ios_base/precision/ to see how you can set the floating-point precision.
That is (s+t+sn)/2.