The square's corners must be at (x,y),(x+1,y),(x+1,y+1), and (x,y+1) for some x and y. So, f(x1,y1)+f(x2,y2)+f(x3,y3)+f(x4,y4)=2(x2+2x)+2((x+1)2+2(x+1))+2(y2+4y)+2((y+1)2+4(y+1))=4x2+12x+6+4y2+20y+10=(2x+3)2−3+(2y+5)2−15≥−18 This attains its minimum value of -18 when x=−23 and y=−25.