EditorialFix one vertex of a convex polygon with AiA_iAi vertices and draw diagonals from it to all nonadjacent vertices. This divides the polygon into Ai−2A_i-2Ai−2 triangles. Print Ai−2A_i-2Ai−2 for each polygon. The total time complexity is O(∑N)O(\sum N)O(∑N). Solution written by GPT6