function nouburja(n)
Mm=2;
x1=2;
y1=2;
x(1,:)=[x1,y1]; y(1,:)=x(1,:);
x2=3;
y2=2;
x(2,:)=[x2,y2]; y(2,:)=x(2,:);
y(3,:)=[3.5,2+sqrt(3)/2]; y(4,:)=[3,2+sqrt(3)];
y(5,:)=[2,2+sqrt(3)]; y(6,:)=[1.5,2+sqrt(3)/2];
mx3=max(x1-2,x2-2); Mx3=min(x1+2,x2+2);
for x3=mx3:n:Mx3
    my3=y2-2; My3=y2+2;
    for i=1:2
        dy=sqrt(4-(x3-x(i,1)).^2);
        if x(i,2)-dy>my3
            my3=x(i,2)-dy;
        end
        if x(i,2)+dy<My3
            My3=x(i,2)+dy;
        end
    end
    for y3=my3:n:My3
        x(3,:)=[x3,y3];
        c3=1;
        for i=1:2
            if norm(x(3,:)-x(i,:))<1
                c3=0;
            end
        end
        if c3
            mx4=max(mx3,x3-2); Mx4=min(Mx3,x3+2);
            for x4=mx4:n:Mx4
                my4=y3-2; My4=y3+2;
                for i=1:3
                    dy=sqrt(4-(x4-x(i,1)).^2);
                    if x(i,2)-dy>my4
                        my4=x(i,2)-dy;
                    end
                    if x(i,2)+dy<My4
                        My4=x(i,2)+dy;
                    end
                end
                for y4=my4:n:My4
                    x(4,:)=[x4,y4];
                    c4=1;
                    for i=1:3
                        if norm(x(4,:)-x(i,:))<1
                            c4=0;
                        end
                    end
                    if c4
                        mx5=max(mx4,x4-2); Mx5=min(Mx4,x4+2);
                        for x5=mx4:n:Mx4
                            my5=y4-2; My5=y4+2;
                            for i=1:4
                                dy=sqrt(4-(x5-x(i,1)).^2);
                                if x(i,2)-dy>my5
                                    my5=x(i,2)-dy;
                                end
                                if x(i,2)+dy<My5
                                    My5=x(i,2)+dy;
                                end
                            end
                            for y5=my5:n:My5
                                x(5,:)=[x5,y5];
                                c5=1;
                                for i=1:4
                                    if norm(x(5,:)-x(i,:))<1
                                        c5=0;
                                    end
                                end
                                if c5
                                    mx6=max(mx5,x5-2); Mx6=min(Mx5,x5+2);
                                    for x6=mx6:n:Mx6
                                        my6=y5-2; My6=y5+2;
                                        for i=1:5
                                            dy=sqrt(4-(x6-x(i,1)).^2);
                                            if x(i,2)-dy>my6
                                                my6=x(i,2)-dy;
                                            end
                                            if x(i,2)+dy<My6
                                                My6=x(i,2)+dy;
                                            end
                                        end
                                        for y6=my6:n:My6
                                            x(6,:)=[x6,y6];
                                            c6=1;
                                            for i=1:5
                                                if norm(x(6,:)-x(i,:))<1
                                                    c6=0;
                                                end
                                            end
                                            if c6
                                                M=0;
                                                for i=1:5
                                                    for j=i+1:6
                                                        d=norm(x(i,:)-x(j,:));
                                                        if d>M
                                                            M=d;
                                                        end
                                                    end
                                                end
                                                if M<Mm
                                                    Mm=M;
                                                    y=x; fprintf('#');
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
end

fprintf('\nEl mínim valor trobat de M/m és %f\n',Mm);
plot(y(:,1),y(:,2),'r');
y
                                          