const TRYs = 900000; type tVec = record x,y,z : real; end; var Norms : array [1..6] of tVec; Ds : array [1..6] of real; count : array [0..63] of word; j : longint; P : tVec; val,i : byte; begin with norms[1] do begin x:=1;y:=0; z:= 0; end; with norms[2] do begin x:=0;y:=1; z:= 0; end; with norms[3] do begin x:=0;y:=0; z:= 1; end; with norms[4] do begin x:=-1;y:=0; z:= 0; end; with norms[5] do begin x:=0;y:=-1; z:= 0; end; with norms[6] do begin x:=0;y:=0; z:= -1; end; for i := 1 to 6 do Ds[i] := -1.0; Fillchar(Count,2*64,0); randomize; for j := 0 to TRYs do begin val := 0; with p do begin x := random * 10.0 - 5; y := random * 10.0 - 5; z := random * 10.0 - 5; end; for i := 1 to 6 do begin val := val shl 1; if (Norms[i].x*p.x + Norms[i].y*p.y + Norms[i].z*p.z + ds[i]) > 0 then inc(val); end; inc(count[val]); end; Assign(output, 'cube.out'); rewrite(output); for j := 0 to 63 do begin for i := 1 to 6 do Write( (j shr (6-i)) and 1); Write(' = ',j:2); WriteLn(' - ', count[j]:5,'=',count[j]/TRYs*100:0:2,'%'); end; close(output); end.