start from the origin(0,0) and remove the duplicated part finally, then get the correct answer