Problem / game
First name
Vihaan
School
Singapore American school
Country
Age
11
File
I will use a trick called manhattan distance to solve those question:D=lx1-x2l+ly1-y2l+lz1-z2l
First put (0,0,0)
D1=x2+y2+z2
Then put (n,0,0)
X2 is less than or equal to n so ln-x2l opens as n-x2
D1-D2=2x1-n x2=(D1-D2+N)/2
put (0,n,0)
D3=X2+n-y2+z2
D1-D3=2y1-n , y=(D1-D3+N)/2
Z2=D1-x2-y2
Answer is ((D1-D2+N)/2,(D1-D3+N)/2,D1- X2-Y2)