Загрузка данных
<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net">
<diagram id="diagram-task3-all" name="Задание 3">
<mxGraphModel dx="1200" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="1000" pageHeight="700" background="#ffffff">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- ==================== 1. СЛЕВА: getCount ==================== -->
<mxCell id="g_start" value="Начало getCount(K, n)" style="rounded=1;arcSize=50;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="40" y="40" width="150" height="40" as="geometry"/>
</mxCell>
<mxCell id="g_init" value="count = 0" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="45" y="105" width="140" height="35" as="geometry"/>
</mxCell>
<mxCell id="g_loop" value="i от 0 до n - 1" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="40" y="165" width="150" height="35" as="geometry"/>
</mxCell>
<mxCell id="g_cond" value="K[i] ≠ 0" style="rhombus;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="45" y="225" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="g_inc" value="count = count + 1" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="45" y="300" width="140" height="35" as="geometry"/>
</mxCell>
<mxCell id="g_join" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#000000;strokeColor=#000000;" vertex="1" parent="1">
<mxGeometry x="113" y="355" width="4" height="4" as="geometry"/>
</mxCell>
<mxCell id="g_ret" value="Возврат count" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="45" y="380" width="140" height="35" as="geometry"/>
</mxCell>
<mxCell id="g_end" value="Конец" style="rounded=1;arcSize=50;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="40" y="440" width="150" height="40" as="geometry"/>
</mxCell>
<mxCell id="ge1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="g_start" target="g_init"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ge2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="g_init" target="g_loop"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ge3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="g_loop" target="g_cond"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ge4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="g_cond" target="g_inc"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="gl_y" value="Да" style="text;html=1;align=center;verticalAlign=middle;fontFamily=Arial;fontSize=11;" vertex="1" parent="1"><mxGeometry x="115" y="275" width="25" height="20" as="geometry"/></mxCell>
<mxCell id="ge5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=none;" edge="1" parent="1" source="g_inc" target="g_join"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ge6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=none;exitX=1;exitY=0.5;entryX=1;entryY=0.5;" edge="1" parent="1" source="g_cond" target="g_join">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="195" y="250"/><mxPoint x="195" y="357"/></Array></mxGeometry>
</mxCell>
<mxCell id="gl_n" value="Нет" style="text;html=1;align=center;verticalAlign=middle;fontFamily=Arial;fontSize=11;" vertex="1" parent="1"><mxGeometry x="175" y="235" width="25" height="20" as="geometry"/></mxCell>
<mxCell id="ge7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;exitX=0.5;exitY=1;entryX=0;entryY=0.5;" edge="1" parent="1" source="g_join" target="g_loop">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="115" y="367"/><mxPoint x="20" y="367"/><mxPoint x="20" y="182"/></Array></mxGeometry>
</mxCell>
<mxCell id="ge8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;exitX=1;exitY=0.5;entryX=1;entryY=0.5;" edge="1" parent="1" source="g_loop" target="g_ret">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="215" y="182"/><mxPoint x="215" y="397"/></Array></mxGeometry>
</mxCell>
<mxCell id="ge9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="g_ret" target="g_end"><mxGeometry relative="1" as="geometry"/></mxCell>
<!-- ==================== 2. В ЦЕНТРЕ: makeX ==================== -->
<mxCell id="m_start" value="Начало makeX(K, n, X)" style="rounded=1;arcSize=50;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="270" y="40" width="150" height="40" as="geometry"/>
</mxCell>
<mxCell id="m_init" value="idx = 0" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="275" y="105" width="140" height="35" as="geometry"/>
</mxCell>
<mxCell id="m_loop" value="i от 0 до n - 1" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="270" y="165" width="150" height="35" as="geometry"/>
</mxCell>
<mxCell id="m_cond" value="K[i] ≠ 0" style="rhombus;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="275" y="225" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="m_act" value="X[idx] = K[i] idx = idx + 1" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="275" y="300" width="140" height="40" as="geometry"/>
</mxCell>
<mxCell id="m_join" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#000000;strokeColor=#000000;" vertex="1" parent="1">
<mxGeometry x="343" y="360" width="4" height="4" as="geometry"/>
</mxCell>
<mxCell id="m_end" value="Конец" style="rounded=1;arcSize=50;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="270" y="440" width="150" height="40" as="geometry"/>
</mxCell>
<mxCell id="me1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="m_start" target="m_init"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="me2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="m_init" target="m_loop"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="me3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="m_loop" target="m_cond"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="me4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="m_cond" target="m_act"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ml_y" value="Да" style="text;html=1;align=center;verticalAlign=middle;fontFamily=Arial;fontSize=11;" vertex="1" parent="1"><mxGeometry x="345" y="275" width="25" height="20" as="geometry"/></mxCell>
<mxCell id="me5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=none;" edge="1" parent="1" source="m_act" target="m_join"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="me6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=none;exitX=1;exitY=0.5;entryX=1;entryY=0.5;" edge="1" parent="1" source="m_cond" target="m_join">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="425" y="250"/><mxPoint x="425" y="362"/></Array></mxGeometry>
</mxCell>
<mxCell id="ml_n" value="Нет" style="text;html=1;align=center;verticalAlign=middle;fontFamily=Arial;fontSize=11;" vertex="1" parent="1"><mxGeometry x="405" y="235" width="25" height="20" as="geometry"/></mxCell>
<mxCell id="me7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;exitX=0.5;exitY=1;entryX=0;entryY=0.5;" edge="1" parent="1" source="m_join" target="m_loop">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="345" y="375"/><mxPoint x="250" y="375"/><mxPoint x="250" y="182"/></Array></mxGeometry>
</mxCell>
<mxCell id="me8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;exitX=1;exitY=0.5;entryX=0.5;entryY=0;" edge="1" parent="1" source="m_loop" target="m_end">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="445" y="182"/><mxPoint x="445" y="415"/><mxPoint x="345" y="415"/></Array></mxGeometry>
</mxCell>
<!-- ==================== 3. СПРАВА: calc ==================== -->
<mxCell id="c_start" value="Начало calc(X, m)" style="rounded=1;arcSize=50;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="510" y="40" width="160" height="40" as="geometry"/>
</mxCell>
<!-- Проверка m <= 1 -->
<mxCell id="c_check" value="m ≤ 1" style="rhombus;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="515" y="100" width="150" height="46" as="geometry"/>
</mxCell>
<mxCell id="c_ret0" value="Возврат 0" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="700" y="105" width="110" height="35" as="geometry"/>
</mxCell>
<!-- Поиск минимума -->
<mxCell id="c_init1" value="minId = 0" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="520" y="165" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="c_loop1" value="i от 1 до m - 1" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="515" y="210" width="150" height="35" as="geometry"/>
</mxCell>
<mxCell id="c_cond1" value="X[i] < X[minId]" style="rhombus;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="520" y="260" width="140" height="45" as="geometry"/>
</mxCell>
<mxCell id="c_act1" value="minId = i" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="530" y="320" width="120" height="30" as="geometry"/>
</mxCell>
<mxCell id="c_j1" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#000000;strokeColor=#000000;" vertex="1" parent="1">
<mxGeometry x="588" y="365" width="4" height="4" as="geometry"/>
</mxCell>
<!-- Подсчет положительных -->
<mxCell id="c_init2" value="count = 0" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="520" y="385" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="c_loop2" value="i от minId + 1 до m - 1" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="510" y="430" width="160" height="35" as="geometry"/>
</mxCell>
<mxCell id="c_cond2" value="X[i] > 0" style="rhombus;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="520" y="480" width="140" height="45" as="geometry"/>
</mxCell>
<mxCell id="c_act2" value="count = count + 1" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="525" y="540" width="130" height="30" as="geometry"/>
</mxCell>
<mxCell id="c_j2" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#000000;strokeColor=#000000;" vertex="1" parent="1">
<mxGeometry x="588" y="585" width="4" height="4" as="geometry"/>
</mxCell>
<mxCell id="c_ret" value="Возврат count" style="whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="520" y="605" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="c_end" value="Конец" style="rounded=1;arcSize=50;whiteSpace=wrap;html=1;fontFamily=Arial;fontSize=12;strokeColor=#000000;strokeWidth=1.5;fillColor=#ffffff;" vertex="1" parent="1">
<mxGeometry x="510" y="655" width="160" height="35" as="geometry"/>
</mxCell>
<!-- Связи calc -->
<mxCell id="ce1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="c_start" target="c_check"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ce2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="c_check" target="c_ret0"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="cl_y0" value="Да" style="text;html=1;align=center;verticalAlign=middle;fontFamily=Arial;fontSize=11;" vertex="1" parent="1"><mxGeometry x="668" y="105" width="25" height="20" as="geometry"/></mxCell>
<mxCell id="ce_r0" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;exitX=0.5;exitY=1;entryX=1;entryY=0.5;" edge="1" parent="1" source="c_ret0" target="c_end">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="755" y="673"/></Array></mxGeometry>
</mxCell>
<mxCell id="ce3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="c_check" target="c_init1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="cl_n0" value="Нет" style="text;html=1;align=center;verticalAlign=middle;fontFamily=Arial;fontSize=11;" vertex="1" parent="1"><mxGeometry x="590" y="145" width="25" height="20" as="geometry"/></mxCell>
<mxCell id="ce4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="c_init1" target="c_loop1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ce5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="c_loop1" target="c_cond1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ce6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="c_cond1" target="c_act1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="cl_y1" value="Да" style="text;html=1;align=center;verticalAlign=middle;fontFamily=Arial;fontSize=11;" vertex="1" parent="1"><mxGeometry x="590" y="300" width="25" height="20" as="geometry"/></mxCell>
<mxCell id="ce7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=none;" edge="1" parent="1" source="c_act1" target="c_j1"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ce8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=none;exitX=1;exitY=0.5;entryX=1;entryY=0.5;" edge="1" parent="1" source="c_cond1" target="c_j1">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="670" y="283"/><mxPoint x="670" y="367"/></Array></mxGeometry>
</mxCell>
<mxCell id="cl_n1" value="Нет" style="text;html=1;align=center;verticalAlign=middle;fontFamily=Arial;fontSize=11;" vertex="1" parent="1"><mxGeometry x="650" y="265" width="25" height="20" as="geometry"/></mxCell>
<mxCell id="ce9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;exitX=0.5;exitY=1;entryX=0;entryY=0.5;" edge="1" parent="1" source="c_j1" target="c_loop1">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="590" y="375"/><mxPoint x="490" y="375"/><mxPoint x="490" y="227"/></Array></mxGeometry>
</mxCell>
<mxCell id="ce10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;exitX=1;exitY=0.5;entryX=1;entryY=0.5;" edge="1" parent="1" source="c_loop1" target="c_init2">
<mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="685" y="227"/><mxPoint x="685" y="400"/></Array></mxGeometry>
</mxCell>
<mxCell id="ce11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="c_init2" target="c_loop2"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ce12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=1.5;endArrow=classic;" edge="1" parent="1" source="c_loop2" target="c_cond2"><mxGeometry relative="1" as="geometry"/></mxCell>
<mxCell id="ce13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;str