We have, 6m+2m+n.3w+2n=332
When m=4,LHS>RHS ∴ Maximum value of m=3
When m=3, 63+23.2n.3w+2n=332 2n(8.3w+1)=332−216 2n(8.3w+1)=116 2n(8×3w+1)=4×29 ∴n=2 8.3w+1=29 ⇒3w=27
[not possible ∵w∈I]
Put m=2, ∴62+22.2n.3w+2n=332 2n(4.3w+1)=332−36 2n(4.3w+1)=296 2n(4.3w+1)=23×37 ∴2n=23 and 4.3w+1=37 n=3 and 3w=9 ⇒w=2
Hence, m,n,w are positive integer ∴m2+mn+n2=(2)2+(2)(3)+(3)2 =4+6+9=19