# How to solve the following system with parametric equation?

What is the maximum number of solutions for this system? Parameters $a_0, a_1, ..., a_{2013}$ could be any numbers. \begin{cases} y = a_0 + |x - a_1| + |x - a_2| + ... + |x - a_{2013}|\\ x^2 + y^2 = 1 \end{cases} I have absolutely no idea how to solve it, any hints are appreciated.

-
Hint: zigzags, or more precisely, instead of 2013, first start with, say, 2. See what the function $y = a_0 + |x-a_1|$ looks like with different choices for $a_0$ and $a_1$. Then try 3,... – Anon Jan 20 '13 at 8:13
It also helps, after you observe the zigzags, to rotate the xy-plane by 45 degrees clockwise, so instead of zigzags, you will be dealing with the easier-to-deal-with "uneven stairs." – Anon Jan 20 '13 at 8:23
I don't think 45 degrees would work... – Tunococ Jan 20 '13 at 8:52
@Tunococ, oh yes, my bad :( Nevermind the 45 degrees. – Anon Jan 20 '13 at 8:59
Anyway, the question doesn't ask to solve the system. It asks about the maximum number of solutions, which I think is $4028$. – Tunococ Jan 20 '13 at 8:59