3 sht
,cnt
:array [0..1000] of longint;
4 num
:array [0..1000,1..2] of longint;
14 initgraph(gd
,gm
,'E:\bp\bgi');
17 if (num
[i
,1]=j
) or (num
[i
,2]=j
) then
18 bar(i
*10,j
*10,i
*10+10,j
*10+10)
20 rectangle(i
*10,j
*10,i
*10+10,j
*10+10);
37 if cnt
[j
]<min
then begin min
:=cnt
[j
]; mw
:=j
; end;
40 for j
:=1 to c
do if sht
[j
]=0 then begin mw
:=num
[j
,1]; break
; end;
41 if min
=0 then begin fail
:=true; break
; end
46 if (sht
[l
]=0) and ((num
[l
,1]=mw
) or (num
[l
,2]=mw
)) then
64 readln(num
[i
,1],num
[i
,2]);
69 if fail
then writeln('NO')
70 else for i
:=1 to c
do write(sht
[i
],' ');