D. Ghosts time limit per test 2 seconds memory limit per test megabytes input standard input output standard output
Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their.
There is nn ghosts in the universe, they move in the oxyoxy plane, each one of the them have its own velocity that does not ch Ange in Time:→v=vx→i+vy→jv→=vxi→+vyj→where VXVX is the IT speed on the Xx-axis and Vyvy are on the Yy-axis.
A Ghost II has experience value Exiexi, which represent how many ghosts tried to scare him in his past. The ghosts scare each and the other if they were in the same Cartesian point at a moment of time.
As the ghosts move with constant speed, after some moment of time there'll be no further scaring (what a relief!) and th E Experience of Ghost kind Gx=∑ni=1exigx=∑i=1nexi would never increase.
Tameem is a red giant, he took a picture of the Cartesian plane at a certain moment of time TT, and magically all the Ghos TS were aligned on a line of the form y=a⋅x+by=a⋅x+b. You had to compute what would be the experience index of the ghost kind gxgx in the indefinite future and this is your task F or today.
Note if Tameem took the picture, GXGX could already be greater than XX, because many ghosts may have scared one anoth Er at any moment between [−∞,t][−∞,t]. Input
The first line contains three integers nn, aa and BB (1≤n≤2000001≤n≤200000, 1≤|a|≤1091≤|a|≤109, 0≤|b