program graphik;
uses crt,graph;
const st=55;
var gd,gm:integer;
x2,x1,y2,y1,r,x,y:integer;
x0,y0:real;

fun:string;


procedure osicoordinat;
const step=55;
var x1,y1,r:integer;
s:string;
begin

 y1:=240; x1:=320; r:=0;
 line(x1-trunc(4.4*step),y1,x1+trunc(4.8*step),y1);
 line(x1,y1-4*step,x1,y1+trunc(3.6*step));
 line(x1+trunc(4.5*step),y1-trunc(0.1*step),x1+trunc(4.8*step),y1);
 line(x1+trunc(4.5*step),y1+trunc(0.1*step),x1+trunc(4.8*step),y1);
 line(x1-trunc(0.1*step),y1-trunc(3.7*step),x1,y1-4*step);
 line(x1+trunc(0.1*step),y1-trunc(3.7*step),x1,y1-4*step);
 outtextxy(x1+trunc(0.2*step),y1-4*step,'Y');
 outtextxy(x1+trunc(4.7*step),y1-trunc(0.4*step),'X');
 str(r div step, S);
 outtextxy(x1-10,y1+6,S);
 while x1+r<x1+4*step do
 begin
 r:=r+step;
 str(r div step, S);
 settextjustify (1,1);
 outtextxy(x1+r,y1+10,S);
 s:='-'+S;
 outtextxy(x1-r,y1+10,S);
 line(x1+r,y1-2,x1+r,y1+2);
 line(x1-r,y1-2,x1-r,y1+2);
 end;
r:=0;
while y1+r<y1+3*step do
begin
r:=r+step;
str(r div step, S);
settextjustify (1,1);
outtextxy(x1-10,y1-r,S);
s:='-'+S;
outtextxy(x1-10,y1+r,S);
line(x1+4,y1+r,x1-4,y1+r);
line(x1+4,y1-r,x1-4,y1-r);
end;
end;

begin

writeln('Введите координаты точки М(x,y) в диапазоне [-4;4]');
readln(x0,y0);

initgraph(gd,gm,'..\pp');

osicoordinat;

y1:=240; x1:=320; r:=2*st;
circle (x1-2*st,y1,r);
line(x1+2*st,y1-3*st,x1+3*st,y1+3*st);
line(x1+3*st,y1+3*st,x1-trunc(3.6*st),y1+trunc(1.2*st));
line(x1-trunc(3.6*st),y1+trunc(1.2*st),x1+2*st,y1-3*st);
SetFillStyle(LtSlashFill,15);
x:=trunc(x1+x0*st); y:=trunc(y1-y0*st);
FloodFill(x,y,15);
SetLineStyle(0,0,3);
PutPixel(x,y,10);
SetColor(4);
outtextxy(x+1,y-10,'M');

readln
end.