{
  "index": "1961-B-4",
  "type": "ANA",
  "tag": [
    "ANA",
    "ALG"
  ],
  "difficulty": "",
  "question": "4. For a fixed positive integer \\( n \\) let \\( x_{1}, x_{2}, \\ldots, x_{n} \\) be real numbers satisfying \\( 0 \\leq x_{k} \\leq 1 \\) for \\( k=1,2, \\ldots, n \\). Determine the maximum value, as a function of \\( n \\), of the sum of the \\( n(n-1) / 2 \\) terms:\n\\[\n\\sum_{\\substack{i . j=1 \\\\ i<j}}^{n}\\left|x_{i}-x_{j}\\right|\n\\]",
  "solution": "Solution. If we keep all but one of the \\( x \\) 's, say \\( x_{2}, x_{3}, \\ldots, x_{n} \\), fixed, then the sum in question is a convex function of \\( x_{1} \\), since it is a sum of convex functions. Hence the maximum value is achieved either for \\( x_{1}=0 \\) or for \\( x_{1}=1 \\); conceivably it could be achieved for both and even for all intermediate values.\n\nSince the set of \\( n \\)-tuples being considered is a bounded closed set in \\( \\mathbf{R}_{n} \\), a maximum is achieved at some point. We can then change any one of the \\( x \\) 's not already either a 0 or a 1 into either a 0 or a 1 without decreasing the sum. Hence among the points where the maximum is achieved there is at least one for which every \\( x \\) is either a 0 or a 1 . Consider this point.\n\nIf \\( p \\) of the \\( x \\) 's are zero and \\( (n-p) \\) are one, then the sum is clearly\n\\[\np(n-p)=\\left(\\frac{n}{2}\\right)^{2}-\\left(\\frac{n}{2}-p\\right)^{2}\n\\]\nand this will be largest when \\( p=n / 2 \\) if \\( n \\) is even, or \\( p=(n \\pm 1) / 2 \\) if \\( n \\) is odd.\n\nThe maximum value of the sum is therefore\n\\[\n\\begin{array}{l}\n\\frac{1}{4} n^{2} \\quad \\text { if } n \\text { is even, } \\\\\n\\frac{1}{4}\\left(n^{2}-1\\right) \\text { if } n \\text { is odd. }\n\\end{array}\n\\]\n\nRemark. If \\( n \\) is even, then the maximum is achieved only if half the \\( x \\) 's are at one end and half at the other. But if \\( n \\) is odd, \\( (n-1) / 2 x \\) 's must be at each end, while the last \\( x \\) may be taken anywhere on the interval.",
  "vars": [
    "x",
    "x_k",
    "x_1",
    "x_2",
    "x_3",
    "x_n",
    "x_i",
    "x_j",
    "p",
    "i",
    "j"
  ],
  "params": [
    "n",
    "R_n"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "x": "realseq",
        "x_k": "entryk",
        "x_1": "entryone",
        "x_2": "entrytwo",
        "x_3": "entrytri",
        "x_n": "entryn",
        "x_i": "entryi",
        "x_j": "entryj",
        "p": "zerotally",
        "i": "indexone",
        "j": "indextwo",
        "n": "totalnum",
        "R_n": "euclidspc"
      },
      "question": "4. For a fixed positive integer \\( totalnum \\) let \\( entryone, entrytwo, \\ldots, entryn \\) be real numbers satisfying \\( 0 \\leq entryk \\leq 1 \\) for \\( k=1,2, \\ldots, totalnum \\). Determine the maximum value, as a function of \\( totalnum \\), of the sum of the \\( totalnum(totalnum-1) / 2 \\) terms:\n\\[\n\\sum_{\\substack{indexone . indextwo=1 \\\\ indexone<indextwo}}^{totalnum}\\left|entryi-entryj\\right|\n\\]",
      "solution": "Solution. If we keep all but one of the \\( realseq \\)'s, say \\( entrytwo, entrytri, \\ldots, entryn \\), fixed, then the sum in question is a convex function of \\( entryone \\), since it is a sum of convex functions. Hence the maximum value is achieved either for \\( entryone=0 \\) or for \\( entryone=1 \\); conceivably it could be achieved for both and even for all intermediate values.\n\nSince the set of \\( totalnum \\)-tuples being considered is a bounded closed set in \\( \\mathbf{euclidspc} \\), a maximum is achieved at some point. We can then change any one of the \\( realseq \\)'s not already either a 0 or a 1 into either a 0 or a 1 without decreasing the sum. Hence among the points where the maximum is achieved there is at least one for which every \\( realseq \\) is either a 0 or a 1. Consider this point.\n\nIf \\( zerotally \\) of the \\( realseq \\)'s are zero and \\( (totalnum-zerotally) \\) are one, then the sum is clearly\n\\[\nzerotally(totalnum-zerotally)=\\left(\\frac{totalnum}{2}\\right)^{2}-\\left(\\frac{totalnum}{2}-zerotally\\right)^{2}\n\\]\nand this will be largest when \\( zerotally=totalnum / 2 \\) if \\( totalnum \\) is even, or \\( zerotally=(totalnum \\pm 1) / 2 \\) if \\( totalnum \\) is odd.\n\nThe maximum value of the sum is therefore\n\\[\n\\begin{array}{l}\n\\frac{1}{4} totalnum^{2} \\quad \\text { if } totalnum \\text { is even, } \\\\\n\\frac{1}{4}\\left(totalnum^{2}-1\\right) \\text { if } totalnum \\text { is odd. }\n\\end{array}\n\\]\n\nRemark. If \\( totalnum \\) is even, then the maximum is achieved only if half the \\( realseq \\)'s are at one end and half at the other. But if \\( totalnum \\) is odd, \\( (totalnum-1) / 2 \\, realseq \\)'s must be at each end, while the last \\( realseq \\) may be taken anywhere on the interval."
    },
    "descriptive_long_confusing": {
      "map": {
        "x": "meadowlark",
        "x_k": "buttercup",
        "x_1": "snowflake",
        "x_2": "dandelion",
        "x_3": "rainforest",
        "x_n": "stingray",
        "x_i": "moonstone",
        "x_j": "blackbird",
        "p": "pineapple",
        "i": "woodpecker",
        "j": "alligator",
        "n": "harmonica",
        "R_n": "wanderlust"
      },
      "question": "4. For a fixed positive integer \\( harmonica \\) let \\( snowflake, dandelion, \\ldots, stingray \\) be real numbers satisfying \\( 0 \\leq buttercup \\leq 1 \\) for \\( k=1,2, \\ldots, harmonica \\). Determine the maximum value, as a function of \\( harmonica \\), of the sum of the \\( harmonica(harmonica-1) / 2 \\) terms:\n\\[\n\\sum_{\\substack{woodpecker . alligator=1 \\\\ woodpecker<alligator}}^{harmonica}\\left|moonstone-blackbird\\right|\n\\]",
      "solution": "Solution. If we keep all but one of the \\( meadowlark \\)'s, say \\( dandelion, rainforest, \\ldots, stingray \\), fixed, then the sum in question is a convex function of \\( snowflake \\), since it is a sum of convex functions. Hence the maximum value is achieved either for \\( snowflake=0 \\) or for \\( snowflake=1 \\); conceivably it could be achieved for both and even for all intermediate values.\n\nSince the set of \\( harmonica \\)-tuples being considered is a bounded closed set in \\( \\mathbf{wanderlust} \\), a maximum is achieved at some point. We can then change any one of the \\( meadowlark \\)'s not already either a 0 or a 1 into either a 0 or a 1 without decreasing the sum. Hence among the points where the maximum is achieved there is at least one for which every \\( meadowlark \\) is either a 0 or a 1. Consider this point.\n\nIf \\( pineapple \\) of the \\( meadowlark \\)'s are zero and \\( (harmonica-pineapple) \\) are one, then the sum is clearly\n\\[\npineapple(harmonica-pineapple)=\\left(\\frac{harmonica}{2}\\right)^{2}-\\left(\\frac{harmonica}{2}-pineapple\\right)^{2}\n\\]\nand this will be largest when \\( pineapple=harmonica / 2 \\) if \\( harmonica \\) is even, or \\( pineapple=(harmonica \\pm 1) / 2 \\) if \\( harmonica \\) is odd.\n\nThe maximum value of the sum is therefore\n\\[\n\\begin{array}{l}\n\\frac{1}{4} harmonica^{2} \\quad \\text { if } harmonica \\text { is even, } \\\\\n\\frac{1}{4}\\left(harmonica^{2}-1\\right) \\text { if } harmonica \\text { is odd. }\n\\end{array}\n\\]\n\nRemark. If \\( harmonica \\) is even, then the maximum is achieved only if half the \\( meadowlark \\)'s are at one end and half at the other. But if \\( harmonica \\) is odd, \\( (harmonica-1) / 2 meadowlark \\)'s must be at each end, while the last \\( meadowlark \\) may be taken anywhere on the interval."
    },
    "descriptive_long_misleading": {
      "map": {
        "x": "fixedconstant",
        "x_k": "fixedconstantk",
        "x_1": "fixedconstantone",
        "x_2": "fixedconstanttwo",
        "x_3": "fixedconstantthree",
        "x_n": "fixedconstantn",
        "x_i": "fixedconstanti",
        "x_j": "fixedconstantj",
        "p": "onesabundance",
        "j": "terminalindex",
        "n": "nullitymeasure",
        "R_n": "complexspace"
      },
      "question": "4. For a fixed positive integer \\( nullitymeasure \\) let \\( fixedconstantone, fixedconstanttwo, \\ldots, fixedconstantn \\) be real numbers satisfying \\( 0 \\leq fixedconstantk \\leq 1 \\) for \\( k=1,2, \\ldots, nullitymeasure \\). Determine the maximum value, as a function of \\( nullitymeasure \\), of the sum of the \\( nullitymeasure(nullitymeasure-1) / 2 \\) terms:\n\\[\n\\sum_{\\substack{i . terminalindex=1 \\\\ i<terminalindex}}^{nullitymeasure}\\left|fixedconstanti-fixedconstantj\\right|\n\\]",
      "solution": "Solution. If we keep all but one of the \\( fixedconstant \\)'s, say \\( fixedconstanttwo, fixedconstantthree, \\ldots, fixedconstantn \\), fixed, then the sum in question is a convex function of \\( fixedconstantone \\), since it is a sum of convex functions. Hence the maximum value is achieved either for \\( fixedconstantone=0 \\) or for \\( fixedconstantone=1 \\); conceivably it could be achieved for both and even for all intermediate values.\n\nSince the set of \\( nullitymeasure \\)-tuples being considered is a bounded closed set in \\( \\mathbf{complexspace} \\), a maximum is achieved at some point. We can then change any one of the \\( fixedconstant \\)'s not already either a 0 or a 1 into either a 0 or a 1 without decreasing the sum. Hence among the points where the maximum is achieved there is at least one for which every \\( fixedconstant \\) is either a 0 or a 1. Consider this point.\n\nIf \\( onesabundance \\) of the \\( fixedconstant \\)'s are zero and \\( (nullitymeasure-onesabundance) \\) are one, then the sum is clearly\n\\[\nonesabundance(nullitymeasure-onesabundance)=\\left(\\frac{nullitymeasure}{2}\\right)^{2}-\\left(\\frac{nullitymeasure}{2}-onesabundance\\right)^{2}\n\\]\nand this will be largest when \\( onesabundance=nullitymeasure / 2 \\) if \\( nullitymeasure \\) is even, or \\( onesabundance=(nullitymeasure \\pm 1) / 2 \\) if \\( nullitymeasure \\) is odd.\n\nThe maximum value of the sum is therefore\n\\[\n\\begin{array}{l}\n\\frac{1}{4} nullitymeasure^{2} \\quad \\text { if } nullitymeasure \\text { is even, } \\\\\n\\frac{1}{4}\\left(nullitymeasure^{2}-1\\right) \\text { if } nullitymeasure \\text { is odd. }\n\\end{array}\n\\]\n\nRemark. If \\( nullitymeasure \\) is even, then the maximum is achieved only if half the \\( fixedconstant \\)'s are at one end and half at the other. But if \\( nullitymeasure \\) is odd, \\( (nullitymeasure-1) / 2 fixedconstant \\)'s must be at each end, while the last \\( fixedconstant \\) may be taken anywhere on the interval."
    },
    "garbled_string": {
      "map": {
        "x": "qzxwvtnp",
        "x_k": "hjgrksla",
        "x_1": "zlmqwert",
        "x_2": "kdjfhgso",
        "x_3": "asdfghjk",
        "x_n": "poiulkjh",
        "x_i": "mnbvcxza",
        "x_j": "plokmijn",
        "p": "rtyuiofg",
        "i": "vhgtrews",
        "j": "qwplmokn",
        "n": "qazwsxed",
        "R_n": "edcrfvtg"
      },
      "question": "4. For a fixed positive integer \\( qazwsxed \\) let \\( zlmqwert, kdjfhgso, \\ldots, poiulkjh \\) be real numbers satisfying \\( 0 \\leq hjgrksla \\leq 1 \\) for \\( k=1,2, \\ldots, qazwsxed \\). Determine the maximum value, as a function of \\( qazwsxed \\), of the sum of the \\( qazwsxed(qazwsxed-1) / 2 \\) terms:\n\\[\n\\sum_{\\substack{vhgtrews . qwplmokn=1 \\\\ vhgtrews<qwplmokn}}^{qazwsxed}\\left|mnbvcxza-plokmijn\\right|\n\\]",
      "solution": "Solution. If we keep all but one of the \\( qzxwvtnp \\)'s, say \\( kdjfhgso, asdfghjk, \\ldots, poiulkjh \\), fixed, then the sum in question is a convex function of \\( zlmqwert \\), since it is a sum of convex functions. Hence the maximum value is achieved either for \\( zlmqwert=0 \\) or for \\( zlmqwert=1 \\); conceivably it could be achieved for both and even for all intermediate values.\n\nSince the set of \\( qazwsxed \\)-tuples being considered is a bounded closed set in \\( \\mathbf{edcrfvtg} \\), a maximum is achieved at some point. We can then change any one of the \\( qzxwvtnp \\)'s not already either a 0 or a 1 into either a 0 or a 1 without decreasing the sum. Hence among the points where the maximum is achieved there is at least one for which every \\( qzxwvtnp \\) is either a 0 or a 1. Consider this point.\n\nIf \\( rtyuiofg \\) of the \\( qzxwvtnp \\)'s are zero and \\( (qazwsxed-rtyuiofg) \\) are one, then the sum is clearly\n\\[\nrtyuiofg(qazwsxed-rtyuiofg)=\\left(\\frac{qazwsxed}{2}\\right)^{2}-\\left(\\frac{qazwsxed}{2}-rtyuiofg\\right)^{2}\n\\]\nand this will be largest when \\( rtyuiofg=qazwsxed / 2 \\) if \\( qazwsxed \\) is even, or \\( rtyuiofg=(qazwsxed \\pm 1) / 2 \\) if \\( qazwsxed \\) is odd.\n\nThe maximum value of the sum is therefore\n\\[\n\\begin{array}{l}\n\\frac{1}{4} qazwsxed^{2} \\quad \\text { if } qazwsxed \\text { is even, } \\\\\n\\frac{1}{4}\\left(qazwsxed^{2}-1\\right) \\text { if } qazwsxed \\text { is odd. }\n\\end{array}\n\\]\n\nRemark. If \\( qazwsxed \\) is even, then the maximum is achieved only if half the \\( qzxwvtnp \\)'s are at one end and half at the other. But if \\( qazwsxed \\) is odd, \\( (qazwsxed-1) / 2 qzxwvtnp \\)'s must be at each end, while the last \\( qzxwvtnp \\) may be taken anywhere on the interval."
    },
    "kernel_variant": {
      "question": "Let n ≥ 2 and d ≥ 1 be fixed integers.  For k = 1,…,n let  \nxₖ = ((xₖ)₁,(xₖ)₂,…,(xₖ)ᵈ) ∈ ℝᵈ satisfy  \n\n(i)   –2 ≤ (xₖ)ⱼ ≤ 4  for every 1 ≤ j ≤ d,  \n\n(ii)  x₁ + x₂ + … + xₙ = 0  (the n vectors have the origin as their centroid).  \n\nDetermine, in closed form, the maximum possible value of  \n\n  S(n,d) =  Σ_{1 ≤ i<j ≤ n}  ‖xᵢ – xⱼ‖₂².\n\nGive your answer as an explicit function of n and d.",
      "solution": "Step 1.  A convenient re-write of the target expression  \nFor any collection of vectors we have the identity  \n\n  Σ_{i<j} ‖xᵢ – xⱼ‖₂² = n Σ_{k=1}^n ‖xₖ‖₂² – ‖Σ_{k=1}^n xₖ‖₂².    (★)\n\nAssumption (ii) gives Σ xₖ = 0, so (★) reduces to  \n\n  S(n,d) = n Σ_{k=1}^n ‖xₖ‖₂².                                (1)\n\nHence maximising S is equivalent to maximising  \n  T := Σ_{k=1}^n ‖xₖ‖₂²                                      (2)\nunder the same constraints (i)–(ii).\n\nStep 2.  Separating the coordinates  \nBecause the squared norm is additive over the coordinates,  \n\n  T = Σ_{j=1}^d Σ_{k=1}^n (xₖ)ⱼ² = Σ_{j=1}^d  Tⱼ,  \n\nwhere for each fixed coordinate j  \n\n  Tⱼ := Σ_{k=1}^n y_k² with y_k = (xₖ)ⱼ,  –2 ≤ y_k ≤ 4, Σ_{k=1}^n y_k = 0.   (3)\n\nThe d coordinates are independent: the global maximum of T is the sum of the\nindividual maxima of the d one-dimensional problems (3).  \nThus it suffices to solve (3) once; the answer will then be multiplied by d.\n\nStep 3.  One dimension – extremal structure  \nFix a coordinate and write y₁,…,yₙ for that coordinate.  The set  \nF(y₁,…,yₙ)=Σ y_k² is a strictly convex function of every variable.\nHence, by the usual “pushing to the boundary’’ argument, in every maximiser\nall but at most one of the y_k’s must lie at an endpoint of the interval [–2,4].\nTherefore a maximising n-tuple has the form\n\n  4, …, 4︸ k times; –2, …, –2︸ m times; (if necessary) one interior value z,   (4)\n\nwith k+m = n or k+m = n–1.  The zero-sum condition forces\n\n  4k – 2m + z = 0   (5)\n\n(the term z is absent if k+m = n).\n\nWe now distinguish the residue of n modulo 3.\n\n––––––––––––––––––––\nCase A: 3 | n (n = 3q).  \nChoose k = q, m = 2q and omit z.  Equation (5) is satisfied\nand every entry is an endpoint, so this is feasible.\nThen  \n\n  Tⱼ = 16k + 4m = 16q + 8q = 24q = 8n.        (6)\n\nNo other choice can yield a larger Tⱼ because replacing any interior z by an\nendpoint preserves (5) and maintains or increases Tⱼ, and any different split\n(k,m) with only endpoints violates (5).\n\n––––––––––––––––––––\nCase B: n ≡ 1 (mod 3) (n = 3q + 1, q ≥ 0).  \nHere it is impossible to satisfy (5) using only endpoints.\nTake k = q fours, m = 2q twos, and let the remaining\nsingle entry be z = 0.  Then (5) holds and  \n\n  Tⱼ = 16q + 4·(2q) + 0² = 24q = 8(n – 1).   (7)\n\nAny competing arrangement must still have k fours and m twos\n(because pushing to endpoints is never harmful) and hence has the same squared\nsum, so (7) is the maximum.\n\n––––––––––––––––––––\nCase C: n ≡ 2 (mod 3) (n = 3q + 2, q ≥ 0).  \nThis time choose k = q fours, m = 2q + 1 twos, and the solitary interior\nentry z = 2.  Equation (5) becomes 4q – 2(2q+1) + 2 = 0, which is true.\nNow  \n\n  Tⱼ = 16q + 4·(2q+1) + 2² = 16q + 8q + 4 + 4 = 24q + 8 = 8(n – 1).   (8)\n\nExactly the same argument as before shows this is optimal.\n\nStep 4.  Collecting the one-dimensional maxima  \nSummarising (6)–(8), for every coordinate  \n\n  max Tⱼ =  ⎧ 8n       if 3 | n,  \n         ⎨ 8(n–1)  otherwise.                               (9)\n\nStep 5.  Returning to d dimensions  \nSince the coordinates are independent and there are d of them,\n\n  T_max = d · max Tⱼ =  ⎧ 8dn       if 3 | n,  \n              ⎨ 8d(n–1) otherwise.                        (10)\n\nPlugging T_max into (1), we finally obtain\n\n  S_max(n,d) = n · T_max  \n      =  ⎧ 8d n²        if 3 divides n,  \n         ⎨ 8d n(n – 1)  if n ≡ 1 or 2 (mod 3).              (11)\n\nStep 6.  Construction realising the bound  \n• 3 | n: take exactly n/3 copies of the vector (4,…,4),  \n     and 2n/3 copies of (–2,…,–2).  \n• n ≡ 1 (mod 3): take q copies of (4,…,4), 2q copies of (–2,…,–2),\n     and one copy of (0,…,0).  \n• n ≡ 2 (mod 3): take q copies of (4,…,4), 2q+1 copies of (–2,…,–2),\n     and one copy of (2,…,2).  \nIn each case the centroid is 0 and equality in (11) is achieved.\n\nHence the required maximum is exactly the quantity displayed in (11).",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.532330",
        "was_fixed": false,
        "difficulty_analysis": "1. Higher dimension: The problem now takes place in ℝᵈ and involves Euclidean\n   distances of vectors, not just real numbers.\n\n2. Additional global constraint:  The centroid of the entire configuration is\n   fixed at the origin, coupling all coordinates and all vectors simultaneously.\n\n3. Multi-layered reduction:  One must first transform the pairwise\n   energy (★), then decouple coordinates, then solve a constrained quadratic\n   optimisation in one variable, and finally re-assemble the results.\n\n4. Modular arithmetic distinction:  The optimal value depends in a subtle way\n   on n (mod 3); recognising and proving these three separate cases is\n   essential.\n\n5. Convex-extremal reasoning in combination with combinatorics:\n   The proof that “all but at most one coordinate sit at an endpoint’’ employs\n   convexity, while deciding which endpoint pattern is best requires careful\n   counting arguments.\n\n6. Non-trivial construction:  Exhibiting configurations that hit the bound\n   in each congruence class demands simultaneous satisfaction of\n   interval bounds, the centroid condition, and maximality of the quadratic\n   form.\n\nAll these layers go well beyond the original and current kernel variants,\nwhich only involved one-dimensional variables with simple interval bounds and\nno global balancing condition."
      }
    },
    "original_kernel_variant": {
      "question": "Let n ≥ 2 and d ≥ 1 be fixed integers.  For k = 1,…,n let  \nxₖ = ((xₖ)₁,(xₖ)₂,…,(xₖ)ᵈ) ∈ ℝᵈ satisfy  \n\n(i)   –2 ≤ (xₖ)ⱼ ≤ 4  for every 1 ≤ j ≤ d,  \n\n(ii)  x₁ + x₂ + … + xₙ = 0  (the n vectors have the origin as their centroid).  \n\nDetermine, in closed form, the maximum possible value of  \n\n  S(n,d) =  Σ_{1 ≤ i<j ≤ n}  ‖xᵢ – xⱼ‖₂².\n\nGive your answer as an explicit function of n and d.",
      "solution": "Step 1.  A convenient re-write of the target expression  \nFor any collection of vectors we have the identity  \n\n  Σ_{i<j} ‖xᵢ – xⱼ‖₂² = n Σ_{k=1}^n ‖xₖ‖₂² – ‖Σ_{k=1}^n xₖ‖₂².    (★)\n\nAssumption (ii) gives Σ xₖ = 0, so (★) reduces to  \n\n  S(n,d) = n Σ_{k=1}^n ‖xₖ‖₂².                                (1)\n\nHence maximising S is equivalent to maximising  \n  T := Σ_{k=1}^n ‖xₖ‖₂²                                      (2)\nunder the same constraints (i)–(ii).\n\nStep 2.  Separating the coordinates  \nBecause the squared norm is additive over the coordinates,  \n\n  T = Σ_{j=1}^d Σ_{k=1}^n (xₖ)ⱼ² = Σ_{j=1}^d  Tⱼ,  \n\nwhere for each fixed coordinate j  \n\n  Tⱼ := Σ_{k=1}^n y_k² with y_k = (xₖ)ⱼ,  –2 ≤ y_k ≤ 4, Σ_{k=1}^n y_k = 0.   (3)\n\nThe d coordinates are independent: the global maximum of T is the sum of the\nindividual maxima of the d one-dimensional problems (3).  \nThus it suffices to solve (3) once; the answer will then be multiplied by d.\n\nStep 3.  One dimension – extremal structure  \nFix a coordinate and write y₁,…,yₙ for that coordinate.  The set  \nF(y₁,…,yₙ)=Σ y_k² is a strictly convex function of every variable.\nHence, by the usual “pushing to the boundary’’ argument, in every maximiser\nall but at most one of the y_k’s must lie at an endpoint of the interval [–2,4].\nTherefore a maximising n-tuple has the form\n\n  4, …, 4︸ k times; –2, …, –2︸ m times; (if necessary) one interior value z,   (4)\n\nwith k+m = n or k+m = n–1.  The zero-sum condition forces\n\n  4k – 2m + z = 0   (5)\n\n(the term z is absent if k+m = n).\n\nWe now distinguish the residue of n modulo 3.\n\n––––––––––––––––––––\nCase A: 3 | n (n = 3q).  \nChoose k = q, m = 2q and omit z.  Equation (5) is satisfied\nand every entry is an endpoint, so this is feasible.\nThen  \n\n  Tⱼ = 16k + 4m = 16q + 8q = 24q = 8n.        (6)\n\nNo other choice can yield a larger Tⱼ because replacing any interior z by an\nendpoint preserves (5) and maintains or increases Tⱼ, and any different split\n(k,m) with only endpoints violates (5).\n\n––––––––––––––––––––\nCase B: n ≡ 1 (mod 3) (n = 3q + 1, q ≥ 0).  \nHere it is impossible to satisfy (5) using only endpoints.\nTake k = q fours, m = 2q twos, and let the remaining\nsingle entry be z = 0.  Then (5) holds and  \n\n  Tⱼ = 16q + 4·(2q) + 0² = 24q = 8(n – 1).   (7)\n\nAny competing arrangement must still have k fours and m twos\n(because pushing to endpoints is never harmful) and hence has the same squared\nsum, so (7) is the maximum.\n\n––––––––––––––––––––\nCase C: n ≡ 2 (mod 3) (n = 3q + 2, q ≥ 0).  \nThis time choose k = q fours, m = 2q + 1 twos, and the solitary interior\nentry z = 2.  Equation (5) becomes 4q – 2(2q+1) + 2 = 0, which is true.\nNow  \n\n  Tⱼ = 16q + 4·(2q+1) + 2² = 16q + 8q + 4 + 4 = 24q + 8 = 8(n – 1).   (8)\n\nExactly the same argument as before shows this is optimal.\n\nStep 4.  Collecting the one-dimensional maxima  \nSummarising (6)–(8), for every coordinate  \n\n  max Tⱼ =  ⎧ 8n       if 3 | n,  \n         ⎨ 8(n–1)  otherwise.                               (9)\n\nStep 5.  Returning to d dimensions  \nSince the coordinates are independent and there are d of them,\n\n  T_max = d · max Tⱼ =  ⎧ 8dn       if 3 | n,  \n              ⎨ 8d(n–1) otherwise.                        (10)\n\nPlugging T_max into (1), we finally obtain\n\n  S_max(n,d) = n · T_max  \n      =  ⎧ 8d n²        if 3 divides n,  \n         ⎨ 8d n(n – 1)  if n ≡ 1 or 2 (mod 3).              (11)\n\nStep 6.  Construction realising the bound  \n• 3 | n: take exactly n/3 copies of the vector (4,…,4),  \n     and 2n/3 copies of (–2,…,–2).  \n• n ≡ 1 (mod 3): take q copies of (4,…,4), 2q copies of (–2,…,–2),\n     and one copy of (0,…,0).  \n• n ≡ 2 (mod 3): take q copies of (4,…,4), 2q+1 copies of (–2,…,–2),\n     and one copy of (2,…,2).  \nIn each case the centroid is 0 and equality in (11) is achieved.\n\nHence the required maximum is exactly the quantity displayed in (11).",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.443876",
        "was_fixed": false,
        "difficulty_analysis": "1. Higher dimension: The problem now takes place in ℝᵈ and involves Euclidean\n   distances of vectors, not just real numbers.\n\n2. Additional global constraint:  The centroid of the entire configuration is\n   fixed at the origin, coupling all coordinates and all vectors simultaneously.\n\n3. Multi-layered reduction:  One must first transform the pairwise\n   energy (★), then decouple coordinates, then solve a constrained quadratic\n   optimisation in one variable, and finally re-assemble the results.\n\n4. Modular arithmetic distinction:  The optimal value depends in a subtle way\n   on n (mod 3); recognising and proving these three separate cases is\n   essential.\n\n5. Convex-extremal reasoning in combination with combinatorics:\n   The proof that “all but at most one coordinate sit at an endpoint’’ employs\n   convexity, while deciding which endpoint pattern is best requires careful\n   counting arguments.\n\n6. Non-trivial construction:  Exhibiting configurations that hit the bound\n   in each congruence class demands simultaneous satisfaction of\n   interval bounds, the centroid condition, and maximality of the quadratic\n   form.\n\nAll these layers go well beyond the original and current kernel variants,\nwhich only involved one-dimensional variables with simple interval bounds and\nno global balancing condition."
      }
    }
  },
  "checked": true,
  "problem_type": "calculation"
}