A working version for maxpointin Line problem

time limited exceeded