Train stops at $n$ stations This is a problem from a mathematical contest I was unable to answer.
I am placing this problem with both the recreational math and calculus tags because I think derivatives are needed.
The problem is:
A train stops in all $n$ stations along its route (including the initial and last ones). At each station, a number of passengers equal to the number of stations ahead get on the train, each one going to different stations. If the maximum number of passengers on the train is $420$ , find the number $n$ .
Any idea? I found $n=40$ , approximately, but it was wrong. 

Derivatives are not required, nor useful, really.
At station $k$, $n-k$ people get on the train, and $k-1$ people get off, so the net increase in passengers is $n-2k+1$.  The number of passengers on the strain as it pulls away from station $s$ is $$\sum_{k=1}^s(n-2k+1)=(n+1)s-2\sum_{k=1}^sk=(n+1)s-s(s+1)=s(n-s),$$ and we are told that the maximum value of this is $420.$ 
When is the maximum achieved?  The number of passengers increases so long as $$n-2k+1>0$$ so we see that if the maximum is achieved at station $s$ then$$s=\left\lfloor{n+1\over2}\right\rfloor,$$ and we have to solve $$\left\lfloor{n+1\over2}\right\rfloor\left(n-\left\lfloor{n+1\over2}\right\rfloor\right)=420$$ 
Can you see how to do this?  
