I have $$$n$$$ lines in the form: $$$y_i=a_i x+b_i$$$, where $$$1\leq n \leq 10^6$$$ and $$$-10^9 \leq a, b \leq 10^9$$$. I need to know how many different lines have the maximum value at some $$$x$$$ (possible $$$x=0$$$).
For example:
At $$$x=0$$$, the lines $$$y_1$$$ and $$$y_2$$$ have the maximum value ($$$20$$$) for that $$$x$$$, but in $$$x=1$$$ just the line $$$y_3$$$ have the maximum value ($$$39$$$), so the answer is 3
, because all of them have the maximum value for some $$$x$$$. How can I implement that?
Thanks in advance