We begin by placing E(4,4) on CD, as shown. [[IMAGE0]] To determine the area of each of the three triangles, consider the base of each to be AB. Points C, D and E each have the same y-coordinate, 4, and so each lies on the horizontal line y=4. The height of each of the three triangles is the vertical distance between the line y=4 and the x-axis (the line through A and B), which is 4. Since AB=7, then the area of each of the three triangles is $21×7×4=14. The sum of the areas of


△
ABC,△ ABD,and△ ABEis3×14=42.△ CDG has non-zero area, so


GcannotlieonCD.OnAB,thereare8possiblelocationsforG. These are the points


(k,0)fortheintegers0≤k≤ 7.OnAD,(1,2) is the only additional point for which the coordinates are both integers. Similarly,


(8,2) is the only additional possibility for


GonBC.Thepoints(1,2)and(8,2)arelabelledMandNrespectively,asshown.[[IMAGE1]]Intotal,thereare10 possibilities for the point


G. Each such triangle has three vertices chosen from the


18 points with integer coordinates on the perimeter of


ABCD, provided that the three vertices are not all on the same line. These


18 points with integer coordinates are the


8pointsonAB(includingAandB),the8pointsonCD(includingCandD),andthe2pointsM(1,2)andN(8,2). Each such triangle is described by exactly one of the following cases: the number of triangle vertices at


MandNis0 the number of triangle vertices at


MandNis1 the number of triangle vertices at


MandNis2 Case 1: the number of triangle vertices at


MandNis0.Inthiscase,2verticesareonABand1vertexisonCD, or vice versa. Consider the triangles with


2verticesonABand1vertexonCD. Consider the base of each such triangle to lie along


AB.Thereis1 such triangle with vertices at


A(0,0)andB(7,0), and thus has base length 7. There are


2 such triangles with base length


6. One of these triangles has vertices at


A(0,0)and(6,0), and the other has vertices at


(1,0)andB(7,0). Continuing in this way, there are


3 triangles with base length


5,4 triangles with base length


4,5 triangles with base length


3,6 triangles with base length


2,and7 triangles with base length


1. Each of these triangles has height


4sinceallpointsonCDareaverticaldistanceof4 from any base that lies along


AB(asinpart(a)).SupposeQisonesuchpointonCD having integer coordinates. The sum of the areas of all triangles having


2verticesonABand1vertexatQis21×4×(1(7)+2(6)+3(5)+4(4)+5(3)+6(2)+7(1))=21×4×84=168 Also, for each of these bases, there are


8 possibilities for the third vertex that lies on


CD. These are the points


(k,4)forintegers2≤k≤ 9. Thus, the sum of the areas of all triangles having


2verticesonABand1vertexonCDis168×8=1344. In a similar way, the sum of the areas of all triangles having


2verticesonCDand1vertexonAB is also 1344, and so the sum of the areas of all triangles in Case 1 is


1344×2=2688. Case 2: the number of triangle vertices at


MandNis1. This case can be divided into the following two subcases:


2verticesareonAB(or2verticesareonCD),and1vertexisMorN1vertexisonAB,1vertexisonCD,and1vertexisMorNSubcase2(i):2verticesonAB(or2verticesonCD),and1vertexisMorN. Consider the triangles with


2verticesonABand1vertexateitherMorN. Consider the base of each such triangle to lie along


AB. The numbers and lengths of these bases are the same as in Case 1. Each of these triangles has height


2sinceMandN are each a vertical distance of


2 from any base that lies along


AB. The sum of the areas of all triangles having


2verticesonABand1vertexatMis21×2×(1(7)+2(6)+3(5)+4(4)+5(3)+6(2)+7(1))=21×2×84=84 Also, for each of these bases, the third vertex could also be


N. Thus, the sum of the areas of all triangles having


2verticesonABand1vertexateitherMorN is 84×2=168. In a similar way, the sum of the areas of all triangles having


2verticesonCDand1vertexateitherMorNis168, and so the sum of the areas of all triangles in Subcase 2(i) is


168×2=336.Subcase2(ii):1vertexisonAB,1vertexisonCD,and1vertexisMorN. Consider two fixed points with integer coordinates, point


PonAB,andpointQonCD.Inthediagram,△ PMQand△ PNQ are two such triangles described by Subcase 2(ii). [[IMAGE2]] The sum of the areas of


△
PMQand△ PNQ is equal to the sum of the areas of


△
PMNand△ QMN.Considerthebaseofboth△
PMNand△ QMNtobeMN,whichhaslength7. Then the height of each triangle is


2. Thus, the sum of the areas of


△
PMNand△ QMNis2×21×2×7=14.Thereare8possiblelocationsforPand8possiblelocationsforQ,andthus8×8=64differentpairsoftrianglesPMNandQMNwhoseareashaveasumof14. (You should confirm for yourself that this is true even when


Pis(0,0)or(7,0)and/orwhenQis(2,4)or(9,4).) The sum of the areas of all triangles in Subcase 2(ii) is


14×64=896. Case 3: the number of triangle vertices at


MandNis2.Inthiscase,1vertexisonAB(oronCD),1vertexisM,and1vertexisN. Consider the triangles with vertices


M,N,and1vertexonAB. Consider the base of each such triangle to be


MN=7. Then each triangle has height


2.Sincethereare8possibleverticesonAB, then the sum of all such triangles is


21×2×7×8=56. In a similar way, the sum of the areas of all triangles having vertices


M,N,and1vertexonCDisalso56, and so the sum of the areas of all triangles in Case 3 is


56×2=112. The sum of the areas of all triangles whose vertices have integer coordinates and lie on the perimeter of


ABCDis2688+336+896+112=4032$.