accepts stdin x y points and outputs