fork(1) download
  1. program Hrm_RaP;{zMar68-27 09/11/2024}
  2. label
  3. 0,1,2,3,G1,G2,G3,G4,G5,G6,Sk1,SLs;
  4. type
  5. DHc=array [0..399]of char;
  6. Int=array [0..399]of integer;
  7. DHv=array [0..399]of real;
  8. MGC=array [0..399,0..399]of real;
  9. GCI=array [0..399,0..399]of char;
  10. In2=array [0..399,0..399]of integer;
  11. var
  12. Hs,Vd,o1,o2,o3,o4:String;
  13. Pm,TNo:String[6];Ms,Ssn:String[4];
  14. Sp1,Sp2,SN1,SN2,oE:String[3];
  15.  
  16. i,j,k,H,L,b,Mi,Si,Oi,h1,h2,h1o,h2o,Wd,Fr,
  17. Er,Me,wt,x,y,z,u,v,m1,Ct,o,u0,v0,Hr,Dy,Mt
  18. ,Yr,sM,sY,Ya,Yo,Yl,Yn,Mn,Dn,Hn,Hi,Sn,xy,
  19. e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,
  20. aST,nD,za,Ho,Min,Po,Ns,zu,z0,zr,Pi,zP,kP,
  21. zF,xS,xP,yW,yP,xG,m2,kT,kR,pT,Sk,kz,An,Xj
  22. ,oEo,Sp,k1,k2,k3,Cw,Sj,rL,Cto,Kc,Lc,Cj,St
  23. ,oH,Rw,p:integer;
  24. r,WgP,mc,mr,F2,r1:real;
  25. a,Sc,Oc,Mar,SAc,OAc,Sf,Md,c1,c3,s1,s2,s3,
  26. s4,u1,u2,u3,u4,Ii,Id,Ih,Ie,Is,B1,B2,uv,Pp
  27. ,Pe,sD,Al,vh,vb,Gn,Cs,Oo,Ip,Om,Xx,Co,Pw,
  28. on,Zz,Yy,Aa,ET,Cl,nr,Rr,Ed,B0,T0,He,Te,Se
  29. ,Ae,Re,PmL,oa,ci,op:char;
  30. Db,De,Hb,Be,Hel,Bb,BDc,PN,Bei,Hol,BMc,DCe
  31. ,T,aT,I1,I2,I3,I4,I5,I6,I7,I8,AEl,Woi,Mli
  32. :DHc;
  33. Ds,Bs,Es,Eg,Ec,G,C,G0,C0,S,Sa,Q,Bg,Bc,Ig,
  34. Ic,Fs,IgC,IcC,RBc,RBg,RBd,RBP,So,e,eE,Ts,
  35. ABs,En0,En,Es0,EcT,EcR,Wg,ETx,eW,F3L,RBo,
  36. RBs,RBm,RBr,TsS,TsM,Bso,TmR,RBa,TsA:DHv;
  37. Hp,Ng,Nc,T1,T2,T3,Ml,Bp,Ba,Ep,jW,jU,Lp,F0
  38. ,F1,Fx,Fz,Ro,Rn,Wn,Wh,La,Pc,Lo,Mo,Wo,Xw,
  39. SL1,SL2:Int;
  40. Wp,Up,SLn,SLf:In2;
  41. M,N,Na,No,Nh,Nha,D,Rp,Ap,Ar:MGC;
  42. BR,SL,DSt:GCI;
  43.  
  44. Begin Read(op);
  45. if op='o'then for i:=1to 5do Readln;
  46.  
  47. Readln;Read(Ii);for i:=1to 35 do
  48. Read(a);Read(ci);Readln(Ct);
  49.  
  50. Cj:=Ct;if Ii='.'then begin Kc:=0;Lc:=0;
  51. if Ct<0then if Cj=-1then Readln(Ct)else
  52. begin Read(Cto);for i:=1to
  53. (Ct-1-(Ct*2))*4 do Readln;Readln(Ct)end;
  54. for i:=1to Ct do begin
  55. Read(k);T1[i]:=k end;Readln;
  56. for i:=1to Ct do begin
  57. Read(k);T2[i]:=k end;Readln;
  58. for i:=1to Ct do begin
  59. Read(k);Ml[i]:=k end;
  60. Write(' k=',k,' Cj=',Cj,' Cto=',Cto);
  61. if Cj<0 then begin while k>0 do Read(k);
  62. Read(Kc);Lc:=Kc+Cj end;
  63. Writeln(' Kc=',Kc,' Lc=',Lc);
  64. for i:=1to Ct do begin
  65. if(T1[i]>8)and(T1[i]<16)then
  66. T1[i]:=T1[i]-8;if T1[i]=16then T1[i]:=8;
  67. if T1[i]>16then T1[i]:=T1[i]-16;
  68. if(T2[i]>8)and(T2[i]<16)then
  69. T2[i]:=T2[i]-8;if T2[i]=16then T2[i]:=8;
  70. if T2[i]>16then T2[i]:=T2[i]-16;
  71. if(Ml[i]>6)and(Ml[i]<12)then
  72. Ml[i]:=Ml[i]-6;if Ml[i]=12then Ml[i]:=6;
  73. if(Ml[i]>12)and(Ml[i]<18)then
  74. Ml[i]:=Ml[i]-12;if Ml[i]=18then Ml[i]:=6;
  75. if Ml[i]>18then Ml[i]:=Ml[i]-18 end end;
  76.  
  77. i:=0;k:=1;if Ii='^'then begin
  78. while k>0 do begin Read(k);i:=i+1;
  79. T3[i]:=k end;Ct:=i-1 end;Readln;
  80.  
  81. if op='p'then for i:=1to 5do Readln;
  82.  
  83. for i:=1to 41do Write('_');Writeln;
  84. Readln(Sp);Read(Cl,a,a,a,sD,a,aST);
  85. for i:=1to 15do Read(a);
  86. Read(PmL,a,a,a,Co);
  87. Readln(a,a,a,a,a,Cs,a,a,a,a,a,a,Gn);
  88. Read(Id,a,a,Ip);for i:=1to 19do Read(a);
  89. Readln(ET,Zz,on,a,Is,a,oa,a,Ih,a,Md,a,
  90. Ie,An);Readln(oE,Hr,a,Min,a,a,Dy,a,a,
  91. Mt,a,a,Yr,a,Xx,Yy,nr,a,Rr,a,oEo,a,Pi);
  92.  
  93. Readln(Ns,a,a,Ssn,a,a,Pm,a,a,Sk,a,
  94. a,a,Yy,a,Zz,a,Aa,a,Ed,a,SN1,a,SN2,k);
  95. Read(a,a,TNo);for i:=1to 21do Read(a);
  96. Readln(T0,a,a,Sp1,a,Sp2,a,B0);
  97.  
  98. for i:=1to 40do Read(a);Readln(Om);
  99. if Om='m'then begin
  100. Readln(o1);Readln end;
  101. for i:=1to 10do begin
  102. Read(a,T[i],a,a);aT[i]:=T[i]end;
  103. for j:=1to k do begin
  104. if Om='n'then Readln;
  105. if Om='m'then begin case(j)of
  106. 1:Readln(o2);2:Readln(o3);3:Readln(o4)
  107. end;Readln;Readln;if j>3then Readln end;
  108. for i:=10*j+1to 10*j+10do begin
  109. Read(a,T[i],a,a);aT[i]:=T[i]end end;
  110. if Om='n'then Readln else
  111. begin Readln;Read(a)end;
  112.  
  113. if Cs='r'then begin
  114. for i:=1to 27do for j:=1to 27do
  115. SL[i,j]:=' ';
  116. for i:=1to Lc do Readln;
  117. k:=Ct;if ci='c'then k:=Cj;
  118. if Cj=27then for i:=1to Cj do Rn[i]:=i
  119. else for i:=1to k do Read(Rn[i]);
  120. if Cj=27then begin Readln;Co:='n'end;
  121. if Lc-Kc<-1then begin
  122. for i:=1to Kc-Lc-1 do Readln;
  123. for i:=1to Cto do Read(k)end;
  124. j:=0;k:=1;while k>0 do begin
  125. Read(k);j:=j+1;Wn[j]:=k;Cw:=j end;
  126. if Wn[1]=0then Read(k);
  127. Read(St);if St>0then begin
  128. Readln;Readln;Readln;
  129. j:=0;k:=1;while k>0 do begin
  130. Read(k);j:=j+1;Wh[j]:=k end end end;
  131.  
  132.  
  133. {S/D}Hr:=(Hr*100)+Min;
  134. if Id='D'then begin
  135. if sD='-'then aST:=aST+60;
  136. if sD='+'then begin
  137. aST:=60-aST;sD:='-'end end;
  138.  
  139. {IN CALENDAR Date Adj}
  140. for za:=0to 1do begin
  141.  
  142. {MONTH START}if Yr=2024then begin
  143. e1:=05116;e4:=15034;e7:=22586;e10:=04318;
  144. e2:=16374;e5:=08225;e8:=09057;e11:=07497;
  145. e3:=10215;e6:=12345;e9:=12277;e12:=00297
  146. end;if Yr=2025then begin
  147. e1:=11155;e4:=20454;e7:=04077;e10:=08488;
  148. e2:=22113;e5:=13535;e8:=13587;e11:=12087;
  149. e3:=16065;e6:=17555;e9:=16597;e12:=05077
  150. end;if Yr=2026then begin
  151. e1:=16245;e4:=02335;e7:=09557;e10:=14368;
  152. e2:=04004;e5:=19415;e8:=19467;e11:=17577;
  153. e3:=21555;e6:=23435;e9:=22487;e12:=10567
  154. end;if Yr=2027then begin
  155. e1:=22135;e4:=08225;e7:=15437;e10:=20258;
  156. e2:=09504;e5:=01296;e8:=01348;e11:=23467;
  157. e3:=03446;e6:=05316;e9:=04368;e12:=16467;
  158. end;case(Mt)of
  159. 1:xy:=e1;5:xy:=e5;9:xy:=e9;
  160. 2:xy:=e2;6:xy:=e6;10:xy:=e10;
  161. 3:xy:=e3;7:xy:=e7;11:xy:=e11;
  162. 4:xy:=e4;8:xy:=e8;12:xy:=e12 end;
  163. k:=0;while xy>=10 do begin
  164. k:=k+1;xy:=xy-10 end;x:=xy;y:=k;
  165.  
  166. sM:=0;
  167. if(Dy<x)or((Dy=x)and(Hr<=y))then sM:=1;
  168. if((Mt=2)and(sM=0))or(Mt>2)then sY:=0
  169. else sY:=1;
  170.  
  171. {CALENDAR CONVERSION}
  172. Db[8]:='W';Db[6]:='W';Db[5]:='w';
  173. Db[4]:='a';Db[2]:='a';Db[1]:='l';
  174. if(Yr>=1984)and(Yr<2044)then begin
  175. Db[7]:='W';Db[3]:='g';Yo:=1984 end;
  176.  
  177. Ya:=Yr-Yo;while Ya>60do Ya:=Ya-60;
  178. if sY=0 then Yn:=(Yr-Yo)+1 else
  179. Yn:=Yr-Yo;while Yn>60 do Yn:=Yn-60;
  180.  
  181. Mn:=(Ya*12)+Mt-sM;
  182. while Mn>60do Mn:=Mn-60;
  183.  
  184. Yl:=Ya;k:=0;while Yl>=4do begin
  185. k:=k+1;Yl:=Yl-4 end;if Yl>0then
  186. k:=k+1;if(Yl=0)and(Ya>0)then k:=k+1;
  187. Dn:=(Ya*365)+k;case(Mt)of
  188. 1:j:=0; 4:j:=90; 7:j:=181;10:j:=273;
  189. 2:j:=31;5:j:=120;8:j:=212;11:j:=304;
  190. 3:j:=59;6:j:=151;9:j:=243;12:j:=334 end;
  191. if(Yl=0)and(Mt=2)then j:=j-1;
  192. Dn:=Dn+j+Dy-1;while Dn>=60do Dn:=Dn-60;
  193.  
  194. if (Hr>=0) and(Hr<100) then Hi:=0;
  195. if (Hr>=100) and(Hr<300) then Hi:=1;
  196. if (Hr>=300) and(Hr<500) then Hi:=2;
  197. if (Hr>=500) and(Hr<700) then Hi:=3;
  198. if (Hr>=700) and(Hr<900) then Hi:=4;
  199. if (Hr>=900) and(Hr<1100)then Hi:=5;
  200. if (Hr>=1100)and(Hr<1300)then Hi:=6;
  201. if (Hr>=1300)and(Hr<1500)then Hi:=7;
  202. if (Hr>=1500)and(Hr<1700)then Hi:=8;
  203. if (Hr>=1700)and(Hr<1900)then Hi:=9;
  204. if (Hr>=1900)and(Hr<2100)then Hi:=10;
  205. if (Hr>=2100)and(Hr<2300)then Hi:=11;
  206. if (Hr>=2300)and(Hr<2400)then Hi:=12;
  207. Hn:=(Dn*12)+Hi;while Hn>=60do Hn:=Hn-60;
  208.  
  209. for i:=1to 4do begin case(i)of
  210. 1:j:=5;2:j:=6;3:j:=7;4:j:=8 end;case(i)of
  211. 1:Sn:=Yn;2:Sn:=Mn;3:Sn:=Dn;4:Sn:=Hn end;
  212. z:=0; 0:repeat
  213. if(Db[i]='a')or(Db[i]='c')or(Db[i]='e')
  214. or(Db[i]='g')or(Db[i]='i')or(Db[i]='k')
  215. then Pp:='+'else Pp:='-';
  216.  
  217. if Sn>0then begin
  218. if Pp='-'then case(Db[j])of
  219. 'W':Db[j]:='F';'F':Db[j]:='E';
  220. 'E':Db[j]:='M';'M':Db[j]:='w';
  221. 'w':Db[j]:='W'end;
  222. case(Db[i])of
  223. 'a':Db[i]:='b';'g':Db[i]:='h';
  224. 'b':Db[i]:='c';'h':Db[i]:='i';
  225. 'c':Db[i]:='d';'i':Db[i]:='j';
  226. 'd':Db[i]:='e';'j':Db[i]:='k';
  227. 'e':Db[i]:='f';'k':Db[i]:='l';
  228. 'f':Db[i]:='g';'l':Db[i]:='a'end end;
  229. z:=z+1;until(Sn=0)or(z=Sn)end;
  230.  
  231. if za=0 then begin
  232. {DATE ADJUSTMENT & Output}k:=0;
  233. if(Yl=0)and(Mt=2)then k:=1;case(Mt)of
  234. 1:nD:=31+k;5:nD:=31+k; 9:nD:=30+k;
  235. 2:nD:=28+k;6:nD:=30+k;10:nD:=31+k;
  236. 3:nD:=31+k;7:nD:=31+k;11:nD:=30+k;
  237. 4:nD:=30+k;8:nD:=31+k;12:nD:=31+k end;
  238. Write(' ',Ih,Cl,Ie,'(',Xx,') ');
  239. if aST>99then Write(aST,sD)
  240. else Write(' ',aST,sD);
  241. Write('(');if Hr<9then Write('000',Hr);
  242. if(Hr<99)and(Hr>9)then Write('00',Hr);
  243. if(Hr<999)and(Hr>99)then Write('0',Hr);
  244. if Hr>999then Write(Hr);Write(') (');
  245. if Dy>9then Write(Dy,')')
  246. else Write('0',Dy,')');Write(' ');
  247. if Mt>9then Write(Mt,' ')else
  248. Write('0',Mt,' ');Writeln(Yr);
  249. k:=0;while Hr>=100do begin
  250. k:=k+1;Hr:=Hr-100 end;Hr:=(60*k)+Hr;
  251.  
  252. if sD='+'then begin Hr:=Hr+aST;
  253. if Hr>1440then begin Hr:=Hr-1440;
  254. if Dy=nD then Dy:=1 else Dy:=Dy+1;
  255. if Dy=1then if Mt=12then
  256. Mt:=1 else Mt:=Mt+1;
  257. if(Mt=1)and(Dy=1)then Yr:=Yr+1 end end;
  258. if sD='-'then begin Hr:=Hr-aST;
  259. if Hr<0then begin if aST<=60then
  260. Hr:=(60-(Hr-(Hr*2)))+1380;if aST>60then
  261. Hr:=(120-(Hr-(Hr*2)))+1320;
  262. if Dy=1then Dy:=nD else Dy:=Dy-1;
  263. if Dy=nD then if Mt=1then
  264. Mt:=12 else Mt:=Mt-1;
  265. if(Mt=12)and(Dy=nD)then Yr:=Yr-1 end end;
  266.  
  267. k:=0;while Hr>=60do begin
  268. k:=k+1;Hr:=Hr-60 end;Hr:=(100*k)+Hr end;
  269.  
  270. if za=1then begin
  271. {HOUR/MONTH Change/Al/Ho MONITOR Output}
  272. Ho:=Hr;k:=0;while Ho>=100do begin
  273. k:=k+1;Ho:=Ho-100 end;Ho:=(60*k)+Ho;
  274. case(Hi)of 0:Ho:=60-Ho;
  275. 1:Ho:=180-Ho;7:Ho:= 900-Ho;
  276. 2:Ho:=300-Ho;8:Ho:=1020-Ho;
  277. 3:Ho:=420-Ho;9:Ho:=1140-Ho;
  278. 4:Ho:=540-Ho;10:Ho:=1260-Ho;
  279. 5:Ho:=660-Ho;11:Ho:=1380-Ho;
  280. 6:Ho:=780-Ho;12:Ho:=1440-Ho end;
  281. if((Ho>=0)and(Ho<10))
  282. or((Ho>=110)and(Ho<120))then Po:=0;
  283. if((Ho>10)and(Ho<=20))
  284. or((Ho>=100)and(Ho<110))then Po:=1;
  285. if((Ho>20)and(Ho<=30))
  286. or((Ho>=90)and(Ho<100))then Po:=2;
  287. if((Ho>30)and(Ho<=40))
  288. or((Ho>=80)and(Ho<90))then Po:=3;
  289. if((Ho>40)and(Ho<=50))
  290. or((Ho>=70)and(Ho<80))then Po:=4;
  291. if((Ho>50)and(Ho<=60))
  292. or((Ho>=60)and(Ho<70))then Po:=5;
  293. case(Hi)of 0:Al:='a';
  294. 1:Al:='b';5:Al:='f'; 9:Al:='j';
  295. 2:Al:='c';6:Al:='g';10:Al:='k';
  296. 3:Al:='d';7:Al:='h';11:Al:='l';
  297. 4:Al:='e';8:Al:='i';12:Al:='a'end;
  298. Write(' (');if Ho<10then Write('00',Ho);
  299. if(Ho<100)and(Ho>9)then Write('0',Ho);
  300. if Ho>99then Write(Ho);
  301. Write(')',Al,' ');
  302.  
  303. if y<10then Write('000',y);
  304. if(y<100)and(y>9)then Write('00',y);
  305. if(y<1000)and(y>99)then Write('0',y);
  306. if y>999then Write(y);
  307. Write('(');if Hr<=9then Write('000',Hr);
  308. if(Hr<99)and(Hr>9)then Write('00',Hr);
  309. if(Hr<999)and(Hr>99)then Write('0',Hr);
  310. if Hr>999then Write(Hr);
  311. Write(') ',x,'(');
  312. if Dy>9then Write(Dy,')')
  313. else Write('0',Dy,')');Write(' ');
  314. if Mt>9then Write(Mt,' ')else
  315. Write('0',Mt,' ');Writeln(Yr);Writeln(
  316. ' ',Db[8],' ',' ',
  317. Db[7],Db[3],' ',Db[6],Db[2],' ',
  318. Db[5],Db[1]);Writeln end {za} end;
  319.  
  320. vh:=Db[7];vb:=Db[3];
  321. if(vh='W')and((vb='a')or(vb='b'))
  322. or(vh='F')and((vb='c')or(vb='d'))
  323. or(vh='E')and((vb='e')or(vb='f'))
  324. or(vh='M')and((vb='g')or(vb='h'))
  325. or(vh='w')and((vb='i')or(vb='j'))
  326. then Vd:=('kl');
  327. if(vh='W')and((vb='k')or(vb='l'))
  328. or(vh='F')and((vb='a')or(vb='b'))
  329. or(vh='E')and((vb='c')or(vb='d'))
  330. or(vh='M')and((vb='e')or(vb='f'))
  331. or(vh='w')and((vb='g')or(vb='h'))
  332. then Vd:=('ij');
  333. if(vh='W')and((vb='i')or(vb='j'))
  334. or(vh='F')and((vb='k')or(vb='l'))
  335. or(vh='E')and((vb='a')or(vb='b'))
  336. or(vh='M')and((vb='c')or(vb='d'))
  337. or(vh='w')and((vb='e')or(vb='f'))
  338. then Vd:=('gh');
  339. if(vh='W')and((vb='g')or(vb='h'))
  340. or(vh='F')and((vb='i')or(vb='j'))
  341. or(vh='E')and((vb='k')or(vb='l'))
  342. or(vh='M')and((vb='a')or(vb='b'))
  343. or(vh='w')and((vb='c')or(vb='d'))
  344. then Vd:=('ef');
  345. if(vh='W')and((vb='e')or(vb='f'))
  346. or(vh='F')and((vb='g')or(vb='h'))
  347. or(vh='E')and((vb='i')or(vb='j'))
  348. or(vh='M')and((vb='k')or(vb='l'))
  349. or(vh='w')and((vb='a')or(vb='b'))
  350. then Vd:=('cd');
  351. if(vh='W')and((vb='c')or(vb='d'))
  352. or(vh='F')and((vb='e')or(vb='f'))
  353. or(vh='E')and((vb='g')or(vb='h'))
  354. or(vh='M')and((vb='i')or(vb='j'))
  355. or(vh='w')and((vb='k')or(vb='l'))
  356. then Vd:=('ab');
  357.  
  358.  
  359. for i:=0to b do ABs[i]:=0;
  360. for i:=1to 10do Wg[i]:=0;
  361. for i:=1to Ct do begin
  362. SL1[i]:=0;SL2[i]:=0 end;
  363.  
  364. z:=0;z0:=0;zP:=0; 1:repeat
  365.  
  366. for i:=1to 5do Wg[i]:=0;
  367.  
  368. zr:=0; 2:repeat zr:=zr+1;
  369.  
  370. {Xx MODES}
  371. if Xx='t'then begin zu:=3;case(zr)of
  372. 1:oEo:=7;2:oEo:=0;3:oEo:=8 end end;
  373. if Xx='d'then begin zu:=2;
  374. case(zr)of 1:oEo:=7;2:oEo:=0 end end;
  375. if Xx='s'then zu:=1;
  376. case(oEo)of 0:Ms:='nEo';
  377. 1:Ms:='nTr';4:Ms:='zTs';7:Ms:='nMm';
  378. 2:Ms:='zTr';5:Ms:='nMr';8:Ms:='zMm';
  379. 3:Ms:='nTs';6:Ms:='zMr';9:Ms:='nEr'end;
  380. on:=Ms[1];ET:=Ms[2];Gn:=Ms[3];
  381.  
  382. case(Pi)of-1:Pi:=161;-2:Pi:=314;
  383. -3:Pi:=809;-4:Pi:=1618;-5:Pi:=3141;
  384. -6:Pi:=8090;-7:Pi:=16180;-8:Pi:=31415;
  385. -9:Pi:=32767 end;
  386. if on='z'then oE[1]:='z';
  387. if ET='T'then oE[2]:=' 'else oE[2]:=ET;
  388. if Gn='r'then oE[3]:=' 'else oE[3]:=Gn;
  389.  
  390. {I1-I8 Loop Ind}
  391. if Ih='_'then I1[zr]:=' 'else I1[zr]:=Ih;
  392. if Cl='_'then I2[zr]:=' 'else I2[zr]:=Cl;
  393. if Ie='*'then I3[zr]:=' 'else I3[zr]:=Ie;
  394.  
  395. if on='z'then
  396. I4[zr]:='z'else I4[zr]:=' ';
  397. if ET='T'then I5[zr]:=' 'else I5[zr]:=ET;
  398. if Gn='r'then I6[zr]:=' 'else I6[zr]:=Gn;
  399. if oa='.'then
  400. I7[zr]:=' 'else I7[zr]:=':';
  401.  
  402. I8[zr]:='?';case(Pi)of 1:I8[zr]:=' ';
  403. 161:I8[zr]:='!';8090:I8[zr]:='(';
  404. 314:I8[zr]:='|';16180:I8[zr]:=')';
  405. 809:I8[zr]:='/';31415:I8[zr]:='^';
  406. 1618:I8[zr]:='<';32767:I8[zr]:='*';
  407. 3141:I8[zr]:='>'end;
  408.  
  409. mc:=30;if(on='z')or(ET='E')then mc:=10;
  410. mr:=10;if Pi=1then mc:=10;
  411.  
  412.  
  413. if Ii='.'then begin L:=Ml[z+1];
  414. H:=(T1[z+1]*10)+T2[z+1];o:=(H*10)+L end;
  415.  
  416. if Ii='^'then begin o:=T3[z+1];
  417. if o=0then goto G1;L:=o;k:=0;
  418. while L>=10do begin k:=k+1;L:=L-10 end;
  419. H:=k;L:=o-(H*10)end;
  420.  
  421. case(o)of
  422. 666:oH:=1;661:oH:=2;662:oH:=3;
  423. 676:oH:=4;671:oH:=5;672:oH:=6;
  424. 686:oH:=7;681:oH:=8;682:oH:=9;
  425. 766:oH:=10;761:oH:=11;762:oH:=12;
  426. 776:oH:=13;771:oH:=14;772:oH:=15;
  427. 786:oH:=16;781:oH:=17;782:oH:=18;
  428. 866:oH:=19;861:oH:=20;862:oH:=21;
  429. 876:oH:=22;871:oH:=23;872:oH:=24;
  430. 886:oH:=25;881:oH:=26;882:oH:=27 end;
  431. Lo[z+1]:=o;Mo[z+1]:=oH;Wo[z+1]:=oH;
  432.  
  433.  
  434. {Mi}case(L)of 1:Mi:=1;2:Mi:=2;
  435. 3:Mi:=3;4:Mi:=4;5:Mi:=5;6:Mi:=6 end;
  436.  
  437. {Hrm DEF:11 - 88}Hb[0]:=' ';case(H)of
  438. 11:Hs:='acegik oo bbbhhh 6 00 00 7 M';
  439. 12:Hs:='aceljh fo bbbiik 5 21 00 8 E';
  440. 13:Hs:='acejhf oo bbbkik 3 00 00 7 M';
  441. 14:Hs:='acegik oo bbbbjf 4 00 00 7 E';
  442. 15:Hs:='acehfd jo bbbgaa 1 31 00 8 W';
  443. 16:Hs:='aceika fo bbblld 4 21 00 8 E';
  444. 17:Hs:='acekac gi bbbjfj 2 21 31 9 E';
  445. 18:Hs:='aceblj fo bbbgkc 3 21 00 8 E';
  446.  
  447. 21:Hs:='fdbgik ao ccehhh 5 51 00 8 E';
  448. 22:Hs:='fdbljh oo cceiik 6 00 00 7 M';
  449. 23:Hs:='fdbjhf ao ccekik 4 50 00 8 E';
  450. 24:Hs:='fdbgik lo ccebjf 3 40 00 8 M';
  451. 25:Hs:='fdbhfd ia ccegaa 4 31 50 9 E';
  452. 26:Hs:='fdbika oo ccelld 1 00 00 7 w';
  453. 27:Hs:='fdbkac io ccejfj 3 31 00 8 E';
  454. 28:Hs:='fdbblj oo ccegkc 2 00 00 7 E';
  455.  
  456. 31:Hs:='dblgik oo ecehhh 3 00 00 7 F';
  457. 32:Hs:='dblljh go eceiik 4 30 00 8 w';
  458. 33:Hs:='dbljhf oo ecekik 6 00 00 7 F';
  459. 34:Hs:='dblgik oo ecebjf 5 00 00 7 w';
  460. 35:Hs:='dblhfd jo ecegaa 2 30 00 8 W';
  461. 36:Hs:='dblika go ecelld 3 30 00 8 w';
  462. 37:Hs:='dblkac gi ecejfj 1 20 30 9 E';
  463. 38:Hs:='dblblj go ecegkc 4 30 00 8 w';
  464.  
  465. 41:Hs:='acegik oo hdlhhh 4 00 00 7 W';
  466. 42:Hs:='aceljh go hdliik 3 40 00 8 W';
  467. 43:Hs:='acejhf oo hdlkik 5 00 00 7 W';
  468. 44:Hs:='acegik oo hdlbjf 6 00 00 7 W';
  469. 45:Hs:='acehfd jo hdlgaa 3 31 00 8 W';
  470. 46:Hs:='aceika go hdllld 2 30 00 8 w';
  471. 47:Hs:='acekac jf hdljfj 4 31 50 9 W';
  472. 48:Hs:='aceblj fo hdlgkc 1 21 00 8 E';
  473.  
  474. 51:Hs:='bljgik co agghhh 1 21 00 8 M';
  475. 52:Hs:='bljljh cg aggiik 4 21 40 9 W';
  476. 53:Hs:='bljjhf do aggkik 2 10 00 8 F';
  477. 54:Hs:='bljgik co aggbjf 3 21 00 8 W';
  478. 55:Hs:='bljhfd oo agggaa 6 00 00 7 W';
  479. 56:Hs:='bljika cg agglld 5 21 40 9 W';
  480. 57:Hs:='bljkac fo aggjfj 3 50 00 8 W';
  481. 58:Hs:='bljblj cg agggkc 4 21 40 9 W';
  482.  
  483. 61:Hs:='ceggik lo ffjhhh 4 30 00 8 F';
  484. 62:Hs:='cegljh oo ffjiik 1 00 00 7 M';
  485. 63:Hs:='cegjhf lo ffjkik 3 30 00 8 F';
  486. 64:Hs:='ceggik ao ffjbjf 2 10 00 8 W';
  487. 65:Hs:='ceghfd lj ffjgaa 5 30 41 9 F';
  488. 66:Hs:='cegika oo ffjlld 6 00 00 7 w';
  489. 67:Hs:='cegkac jo ffjjfj 4 41 00 8 F';
  490. 68:Hs:='cegblj oo ffjgkc 3 00 00 7 w';
  491.  
  492. 71:Hs:='egigik ac dldhhh 2 10 20 9 M';
  493. 72:Hs:='egiljh do dldiik 3 20 00 8 M';
  494. 73:Hs:='egijhf dl dldkik 1 10 31 9 F';
  495. 74:Hs:='egigik dl dldbjf 4 20 40 9 M';
  496. 75:Hs:='egihfd ao dldgaa 3 50 00 8 E';
  497. 76:Hs:='egiika do dldlld 4 20 00 8 M';
  498. 77:Hs:='egikac oo dldjfj 6 00 00 7 E';
  499. 78:Hs:='egiblj do dldgkc 5 20 00 8 M';
  500.  
  501. 81:Hs:='hfdgik ao aeihhh 3 10 00 8 M';
  502. 82:Hs:='hfdljh oo aeiiik 2 00 00 7 M';
  503. 83:Hs:='hfdjhf ao aeikik 4 10 00 8 M';
  504. 84:Hs:='hfdgik ao aeibjf 1 10 00 8 W';
  505. 85:Hs:='hfdhfd ai aeigaa 4 10 50 9 M';
  506. 86:Hs:='hfdika oo aeilld 3 00 00 7 E';
  507. 87:Hs:='hfdkac io aeijfj 5 50 00 8 M';
  508. 88:Hs:='hfdblj oo aeigkc 6 00 00 7 E'end;
  509.  
  510. for i:=1to 9do Hb[i]:=Hs[i];
  511. Hb[7]:=Hs[L+10];
  512. case(Hs[18])of
  513. '1':Si:=1;'2':Si:=2;'3':Si:=3;
  514. '4':Si:=4;'5':Si:=5;'6':Si:=6 end;
  515. case(Hs[20])of
  516. '0':h1:=0;'1':h1:=1;'2':h1:=2;
  517. '3':h1:=3;'4':h1:=4;'5':h1:=5 end;
  518. case(Hs[21])of '0':h1o:=0;'1':h1o:=1 end;
  519. case(Hs[23])of
  520. '0':h2:=0;'1':h2:=1;'2':h2:=2;
  521. '3':h2:=3;'4':h2:=4;'5':h2:=5 end;
  522. case(Hs[24])of '0':h2o:=0;'1':h2o:=1 end;
  523. case(Hs[26])of
  524. '7':b:=7;'8':b:=8;'9':b:=9 end;
  525. Pe:=Hs[28];
  526.  
  527.  
  528. {Oi}if Si<4then Oi:=Si+3 else Oi:=Si-3;
  529. {Hel : Hid Elm label}
  530. for i:=1to 6do Hel[i]:=' ';
  531. for i:=1to 6do begin
  532. if i=h1 then Hel[i]:=Hb[8];
  533. if i=h2 then Hel[i]:=Hb[9] end;
  534.  
  535.  
  536. {STRENGTH ALLOCATION: Q}
  537. Q[1]:=1; {o >}Q[2]:=0.5;{<}
  538. Q[3]:=0.25;{v }Q[4]:=0.1;{x}
  539.  
  540. {FOUR PILLARS Step: S}S[1]:=1;
  541. S[2]:=1; S[3]:=5/6; S[4]:=4/6;
  542.  
  543.  
  544. {FOUR PILLARS Date Strength}
  545. for i:=1to 8do begin case(Db[i])of
  546. 'a':De[i]:='w';'b':De[i]:='E';
  547. 'c':De[i]:='W';'d':De[i]:='W';
  548. 'e':De[i]:='E';'f':De[i]:='F';
  549. 'g':De[i]:='F';'h':De[i]:='E';
  550. 'i':De[i]:='M';'j':De[i]:='M';
  551. 'k':De[i]:='E';'l':De[i]:='w';
  552. 'W':De[i]:='W';'F':De[i]:='F';
  553. 'E':De[i]:='E';'M':De[i]:='M';
  554. 'w':De[i]:='w'end end;
  555.  
  556. for i:=1to 8do for j:=1to 8do D[i,j]:=1;
  557. D[1,2]:=S[2];D[2,1]:=S[2];D[3,1]:=S[3];
  558. D[1,3]:=S[3];D[2,3]:=S[2];D[3,2]:=S[2];
  559. D[1,4]:=S[4];D[2,4]:=S[3];D[3,4]:=S[2];
  560. D[1,5]:=S[1];D[2,5]:=S[2];D[3,5]:=S[3];
  561. D[1,6]:=S[2];D[2,6]:=S[1];D[3,6]:=S[2];
  562. D[1,7]:=S[3];D[2,7]:=S[2];D[3,7]:=S[1];
  563. D[1,8]:=S[4];D[2,8]:=S[3];D[3,8]:=S[2];
  564.  
  565. D[4,1]:=S[4];D[5,1]:=S[1];D[6,1]:=S[2];
  566. D[4,2]:=S[3];D[5,2]:=S[2];D[6,2]:=S[1];
  567. D[4,3]:=S[2];D[5,3]:=S[3];D[6,3]:=S[2];
  568. D[4,5]:=S[4];D[5,4]:=S[4];D[6,4]:=S[3];
  569. D[4,6]:=S[3];D[5,6]:=S[2];D[6,5]:=S[2];
  570. D[4,7]:=S[2];D[5,7]:=S[3];D[6,7]:=S[2];
  571. D[4,8]:=S[1];D[5,8]:=S[4];D[6,8]:=S[3];
  572.  
  573. D[7,1]:=S[3];D[8,1]:=S[4];
  574. D[7,2]:=S[2];D[8,2]:=S[3];
  575. D[7,3]:=S[1];D[8,3]:=S[2];
  576. D[7,4]:=S[2];D[8,4]:=S[1];
  577. D[7,5]:=S[3];D[8,5]:=S[4];
  578. D[7,6]:=S[2];D[8,6]:=S[3];
  579. D[7,8]:=S[2];D[8,7]:=S[2];
  580.  
  581. for i:=1to 8do Ds[i]:=0;
  582. for i:=1to 8do for j:=1to 8do
  583. if(i>j)or(i<j)then begin
  584. if De[i]='W'then case(De[j])of
  585. 'w':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  586. 'W':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  587. 'F':Ds[i]:=Ds[i]+(D[i,j]*Q[2]);
  588. 'E':Ds[i]:=Ds[i]+(D[i,j]*Q[3]);
  589. 'M':Ds[i]:=Ds[i]+(D[i,j]*Q[4])end;
  590. if De[i]='F'then case(De[j])of
  591. 'W':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  592. 'F':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  593. 'E':Ds[i]:=Ds[i]+(D[i,j]*Q[2]);
  594. 'M':Ds[i]:=Ds[i]+(D[i,j]*Q[3]);
  595. 'w':Ds[i]:=Ds[i]+(D[i,j]*Q[4])end;
  596. if De[i]='E'then case(De[j])of
  597. 'F':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  598. 'M':Ds[i]:=Ds[i]+(D[i,j]*Q[2]);
  599. 'w':Ds[i]:=Ds[i]+(D[i,j]*Q[3]);
  600. 'W':Ds[i]:=Ds[i]+(D[i,j]*Q[4])end;
  601. if(De[i]='E')and(De[j]='E')then begin
  602. if(Db[i]='b')and(Db[j]='h')or
  603. (Db[i]='h')and(Db[j]='b')or
  604. (Db[i]='e')and(Db[j]='k')or
  605. (Db[i]='k')and(Db[j]='e')then
  606. Ds[i]:=Ds[i]+(D[i,j]*Q[4])else
  607. Ds[i]:=Ds[i]+(D[i,j]*Q[1])end;
  608. if De[i]='M'then case(De[j])of
  609. 'E':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  610. 'M':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  611. 'w':Ds[i]:=Ds[i]+(D[i,j]*Q[2]);
  612. 'W':Ds[i]:=Ds[i]+(D[i,j]*Q[3]);
  613. 'F':Ds[i]:=Ds[i]+(D[i,j]*Q[4])end;
  614. if De[i]='w'then case (De[j])of
  615. 'M':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  616. 'w':Ds[i]:=Ds[i]+(D[i,j]*Q[1]);
  617. 'W':Ds[i]:=Ds[i]+(D[i,j]*Q[2]);
  618. 'F':Ds[i]:=Ds[i]+(D[i,j]*Q[3]);
  619. 'E':Ds[i]:=Ds[i]+(D[i,j]*Q[4])end end;
  620.  
  621. for i:=1to 8do begin
  622. if i=5then Ds[i]:=Ds[i]*(4/5)*(2/3);
  623. if i=1then Ds[i]:=Ds[i]*(4/5);
  624. if i=6then Ds[i]:=Ds[i]{*4/3}*(2/3);
  625. if i=2then Ds[i]:=Ds[i]*(4/3);
  626. if i=7then Ds[i]:=Ds[i]*(2/3);
  627. if i=8then Ds[i]:=Ds[i]*(7/10)*(3/6);
  628. if i=4then Ds[i]:=Ds[i]*(7/10);
  629. if Db[i]='o'then Ds[i]:=0 end;
  630. {Hrm branches Date strg}Be[0]:=' ';
  631. for i:=1to b do begin case(Hb[i])of
  632. 'a':Be[i]:='w';'b':Be[i]:='E';
  633. 'c':Be[i]:='W';'d':Be[i]:='W';
  634. 'e':Be[i]:='E';'f':Be[i]:='F';
  635. 'g':Be[i]:='F';'h':Be[i]:='E';
  636. 'i':Be[i]:='M';'j':Be[i]:='M';
  637. 'k':Be[i]:='E';'l':Be[i]:='w'end end;
  638.  
  639. for i:=1to b do for j:=1to 8do M[i,j]:=0;
  640. for i:=1to b do for j:=1to 8do begin
  641. if Be[i]='W'then case(De[j])of
  642. 'w':M[i,j]:=Q[1];'W':M[i,j]:=Q[1];
  643. 'F':M[i,j]:=Q[2];'E':M[i,j]:=Q[3];
  644. 'M':M[i,j]:=Q[4]end;
  645. if Be[i]='F'then case(De[j])of
  646. 'W':M[i,j]:=Q[1];'F':M[i,j]:=Q[1];
  647. 'E':M[i,j]:=Q[2];'M':M[i,j]:=Q[3];
  648. 'w':M[i,j]:=Q[4]end;
  649. if Be[i]='E'then case(De[j])of
  650. 'F':M[i,j]:=Q[1];'M':M[i,j]:=Q[2];
  651. 'w':M[i,j]:=Q[3];'W':M[i,j]:=Q[4]end;
  652. if(Be[i]='E')and(De[j]='E')then begin
  653. if(Hb[i]='b')and(Db[j]='h')or
  654. (Hb[i]='h')and(Db[j]='b')or
  655. (Hb[i]='e')and(Db[j]='k')or
  656. (Hb[i]='k')and(Db[j]='e')then
  657. M[i,j]:=Q[4]else M[i,j]:=Q[1]end;
  658. if Be[i]='M'then case(De[j])of
  659. 'E':M[i,j]:=Q[1];'M':M[i,j]:=Q[1];
  660. 'w':M[i,j]:=Q[2];'W':M[i,j]:=Q[3];
  661. 'F':M[i,j]:=Q[4]end;
  662. if Be[i]='w'then case(De[j])of
  663. 'M':M[i,j]:=Q[1];'w':M[i,j]:=Q[1];
  664. 'W':M[i,j]:=Q[2];'F':M[i,j]:=Q[3];
  665. 'E':M[i,j]:=Q[4]end end;
  666.  
  667. {Bs}for i:=1to 19do Bs[i]:=0;
  668. for i:=1to b do for j:=1to 8do
  669. begin Bs[i]:=Bs[i]+(Ds[j]*M[i,j])end;
  670. {Bs %}Bs[0]:=0;for i:=1to b do
  671. Bs[0]:=Bs[0]+Bs[i];for i:=1to b do
  672. Bs[i]:=((Bs[i]*100)/Bs[0])/100;Pw:='_';
  673.  
  674.  
  675. {Elm order by Self pos - 3}
  676. if Be[Si]='W'then begin
  677. Wd:=3; Fr:=4;Er:=5;Me:=1;wt:=2 end;
  678. if Be[Si]='F'then begin
  679. Wd:=2; Fr:=3;Er:=4;Me:=5;wt:=1 end;
  680. if Be[Si]='E'then begin
  681. Wd:=1; Fr:=2;Er:=3;Me:=4;wt:=5 end;
  682. if Be[Si]='M'then begin
  683. Wd:=5; Fr:=1;Er:=2;Me:=3;wt:=4 end;
  684. if Be[Si]='w' then begin
  685. Wd:=4; Fr:=5;Er:=1;Me:=2;wt:=3 end;
  686.  
  687. {Bp : Brch pos/no in Elm spread/SELF}
  688. for i:=1to b do case(Be[i])of
  689. 'W':Bp[i]:=Wd;'F':Bp[i]:=Fr;
  690. 'E':Bp[i]:=Er;'M':Bp[i]:=Me;
  691. 'w':Bp[i]:=wt end;
  692. {Bp : Brch pos/no in Elm spread/Ts}
  693. for i:=1to b do case(Be[i])of
  694. 'W':Ep[i]:=1;'F':Ep[i]:=2;
  695. 'E':Ep[i]:=3;'M':Ep[i]:=4;
  696. 'w':Ep[i]:=5 end;
  697.  
  698. {BR : Bch/Bch relation}
  699. Be[b+9]:='W';Be[b+10]:='F';Be[b+11]:='E';
  700. Be[b+12]:='M';Be[b+13]:='w';
  701.  
  702. for i:=0to b+8+5do for j:=0to b+8+5do
  703. BR[i,j]:=' ';for i:=1to 8do begin
  704. Be[b+i]:=De[i];Hb[b+i]:=Db[i] end;
  705.  
  706. for i:=0to b+8+5do for j:=0to b+8+5do
  707. begin if(Be[i]=' ')or(Be[j]=' ')then
  708. BR[i,j]:=' ';
  709. if Be[i]='W'then case(Be[j])of
  710. 'W':BR[i,j]:='o';'F':BR[i,j]:='<';
  711. 'E':BR[i,j]:='v';'M':BR[i,j]:='x';
  712. 'w':BR[i,j]:='>'end;
  713. if Be[i]='F'then case(Be[j])of
  714. 'W':BR[i,j]:='>';'F':BR[i,j]:='o';
  715. 'E':BR[i,j]:='<';'M':BR[i,j]:='v';
  716. 'w':BR[i,j]:='x'end;
  717. if Be[i]='E'then case(Be[j])of
  718. 'W':BR[i,j]:='x';'F':BR[i,j]:='>';
  719. 'M':BR[i,j]:='<';'w':BR[i,j]:='v'end;
  720. if(Be[i]='E')and(Be[j]='E')then begin
  721. if(Hb[i]='b')and(Hb[j]='h')or
  722. (Hb[i]='h')and(Hb[j]='b')or
  723. (Hb[i]='e')and(Hb[j]='k')or
  724. (Hb[i]='k')and(Hb[j]='e')then
  725. BR[i,j]:='*'else BR[i,j]:='o';
  726. if Hb[i]=Hb[j]then BR[i,j]:='O'end;
  727. if Be[i]='M'then case(Be[j])of
  728. 'W':BR[i,j]:='v';'F':BR[i,j]:='x';
  729. 'E':BR[i,j]:='>';'M':BR[i,j]:='o';
  730. 'w':BR[i,j]:='<'end;
  731. if Be[i]='w'then case(Be[j])of
  732. 'W':BR[i,j]:='<';'F':BR[i,j]:='v';
  733. 'E':BR[i,j]:='x';'M':BR[i,j]:='>';
  734. 'w':BR[i,j]:='o'end end;
  735.  
  736. {Bb : Branch bind to Date}
  737. for i:=0to b do Bb[i]:=' ';
  738. for j:=1to 4do for i:=1to b do
  739. if(Hb[i]='a')and(Db[j]='b')or
  740. (Hb[i]='b')and(Db[j]='a')or
  741. (Hb[i]='c')and(Db[j]='l')or
  742. (Hb[i]='l')and(Db[j]='c')or
  743. (Hb[i]='d')and(Db[j]='k')or
  744. (Hb[i]='k')and(Db[j]='d')or
  745. (Hb[i]='e')and(Db[j]='j')or
  746. (Hb[i]='j')and(Db[j]='e')or
  747. (Hb[i]='f')and(Db[j]='i')or
  748. (Hb[i]='i')and(Db[j]='f')or
  749. (Hb[i]='g')and(Db[j]='h')or
  750. (Hb[i]='h')and(Db[j]='g')then
  751. Bb[i]:='~';
  752.  
  753. {ACTIVE Line}for i:=1to 9do La[i]:=0;
  754. for i:=1to b do
  755. if((h1=Mi)and(i=8))or((h2=Mi)and(i=9))
  756. or(i=Mi)or(i=7)then La[i]:=1;
  757.  
  758. {DAY CLASH : Active line - BDc}
  759. for i:=1to b do BDc[i]:=' ';
  760. for i:=1to b do
  761. if(Hb[i]='a')and(Db[3]='g')or
  762. (Hb[i]='b')and(Db[3]='h')or
  763. (Hb[i]='c')and(Db[3]='i')or
  764. (Hb[i]='d')and(Db[3]='j')or
  765. (Hb[i]='e')and(Db[3]='k')or
  766. (Hb[i]='f')and(Db[3]='l')or
  767. (Hb[i]='g')and(Db[3]='a')or
  768. (Hb[i]='h')and(Db[3]='b')or
  769. (Hb[i]='i')and(Db[3]='c')or
  770. (Hb[i]='j')and(Db[3]='d')or
  771. (Hb[i]='k')and(Db[3]='e')or
  772. (Hb[i]='l')and(Db[3]='f')then
  773. BDc[i]:='|';
  774.  
  775. {BRANCH CLASHED by Act line : BMc/DCe}
  776. for i:=1to b do begin
  777. BMc[i]:=' ';DCe[i]:=' ' end;
  778. for i:=1to b do for j:=1to b do
  779. if(Hb[i]='a')and(Hb[j]='g')or
  780. (Hb[i]='b')and(Hb[j]='h')or
  781. (Hb[i]='c')and(Hb[j]='i')or
  782. (Hb[i]='d')and(Hb[j]='j')or
  783. (Hb[i]='e')and(Hb[j]='k')or
  784. (Hb[i]='f')and(Hb[j]='l')or
  785. (Hb[i]='g')and(Hb[j]='a')or
  786. (Hb[i]='h')and(Hb[j]='b')or
  787. (Hb[i]='i')and(Hb[j]='c')or
  788. (Hb[i]='j')and(Hb[j]='d')or
  789. (Hb[i]='k')and(Hb[j]='e')or
  790. (Hb[i]='l')and(Hb[j]='f')then
  791. begin if La[j]=1 then BMc[i]:='*';
  792. if(BDc[j]='|')and(Hb[i]=Db[3])
  793. then DCe[i]:='-'end;
  794.  
  795. {ACTIVE Branch}for i:=1to 9do Ba[i]:=0;
  796. for i:=1to b do begin a:=BMc[i];
  797. if Ie='_'then if a='*'then a:=' ';
  798. if(BDc[i]='|')or(a='*')or(La[i]=1)
  799. then Ba[i]:=1 end;
  800.  
  801. Mar:=' ';
  802. if((Hb[Mi]='c')and(Hb[7]='d'))or
  803. ((Hb[Mi]='f')and(Hb[7]='g'))or
  804. ((Hb[Mi]='i')and(Hb[7]='j'))or
  805. ((Hb[Mi]='l')and(Hb[7]='a'))then
  806. Mar:='A';
  807. if((Hb[Mi]='d')and(Hb[7]='c'))or
  808. ((Hb[Mi]='g')and(Hb[7]='f'))or
  809. ((Hb[Mi]='j')and(Hb[7]='i'))or
  810. ((Hb[Mi]='a')and(Hb[7]='l'))then
  811. Mar:='R';
  812. {INC/DEC : Adv/Ret - BDc|/}
  813. for i:=1to b do if((i=Mi)or(i=7))
  814. and(Mar='A')then Bs[i]:=Bs[i]*1.25;
  815. for i:=1to b do if((i=Mi)or(i=7))
  816. and(Mar='R')then Bs[i]:=Bs[i]*0.75;
  817.  
  818. for i:=1to b do if(BDc[i]='|')and
  819. (((h1=Mi)and(i=8))or((h2=Mi)and(i=9))
  820. or(i=Mi)or(i=7))then begin
  821. BDc[i]:='/';Bs[i]:=Bs[i]*3/4 end;
  822.  
  823.  
  824. {Hid Branch IN/OUT ind : h1o/h2o}
  825. if(h1>0)and(h1o=1)then h1o:=1
  826. else h1o:=0;
  827. if(h2>0)and(h2o=1)then h2o:=1
  828. else h2o:=0;
  829.  
  830. if Ih='_'then begin
  831. for i:=1to b do begin
  832. if(h1o=1)or((BR[8,i]='>')and(Ba[i]=1))
  833. then h1o:=2;
  834. if(h2o=1)or((BR[9,i]='>')and(Ba[i]=1))
  835. then h2o:=2 end end;
  836.  
  837. {Hol : Hid Branch NOT/OUT label}
  838. if h1o>0then Hol[8]:=' 'else Hol[8]:='_';
  839. if h2o>0then Hol[9]:=' 'else Hol[9]:='_';
  840.  
  841.  
  842. {INT STEP : So S Sa - Hrm BRANCH INT}
  843. So[1]:=0.60; So[2]:=0.60; So[3]:=0;
  844. So[4]:=0; So[5]:=0; So[6]:=0;
  845.  
  846. if Ih='!'then begin
  847. S[1]:=0.60; S[2]:=0.60; S[3]:=0;
  848. S[4]:=0; S[5]:=0; S[6]:=0 end;
  849.  
  850. if Ih='_'then begin
  851. S[1]:=0.60; S[2]:=0.60; S[3]:=0.40;
  852. S[4]:=0.20; S[5]:=0.10; S[6]:=0.05 end;
  853.  
  854. Sa[1]:=1; Sa[2]:=0.95; Sa[3]:=0.80;
  855. Sa[4]:=0.59; Sa[5]:=0.30; Sa[6]:=0.15;
  856.  
  857.  
  858. {STEP value N/Na/No/Nh/Nha - Hrm BR INT}
  859. for i:=1to b do Hp[i]:=0;
  860. for i:=1to b do for j:=1to b do
  861. begin N[i,j]:=0;Na[i,j]:=0;
  862. Nh[i,j]:=0;Nha[i,j]:=0 end;
  863.  
  864. for i:=1to b do case(i)of
  865. 7:Hp[i]:=Mi;8:Hp[i]:=h1;9:Hp[i]:=h2;
  866. else Hp[i]:=i end;
  867.  
  868. for i:=1to b do for j:=1to b do
  869. if(i>j)or(i<j)then begin
  870. x:=Hp[i];y:=Hp[j];
  871. if(Hp[i]>Hp[j])then N[i,j]:=S[(x-y)+1]
  872. else N[i,j]:=S[(y-x)+1];
  873. if(Hp[i]>Hp[j])then Na[i,j]:=Sa[(x-y)+1]
  874. else Na[i,j]:=Sa[(y-x)+1];
  875.  
  876. if(Hp[i]>Hp[j])then No[i,j]:=So[(x-y)+1]
  877. else No[i,j]:=So[(y-x)+1];
  878.  
  879. if(Hp[i]>Hp[j])then Nh[i,j]:=S[(x-y)+1]/2
  880. else Nh[i,j]:=S[(y-x)+1]/2;
  881. if(Hp[i]>Hp[j])then
  882. Nha[i,j]:=Sa[(x-y)+1]/2 else
  883. Nha[i,j]:=Sa[(y-x)+1]/2 end;
  884.  
  885. { Na : Mov Ln / Day Clash Ln}
  886. for i:=1to b do for j:=1to b do
  887. if(i>j)or(i<j)then begin
  888. if Ba[i]=1then begin N[i,i]:=0.01;
  889. N[i,j]:=Na[i,j];N[j,i]:=Na[j,i];
  890. No[i,j]:=Na[i,j];No[j,i]:=Na[j,i]end;
  891. { Nha '_' Hid Act Ln - NOT/OUT}
  892. if Ih='_'then begin
  893. if(i=8)and(Ba[i]=1)and(h1o<1)then begin
  894. N[i,j]:=Nha[i,j];N[j,i]:=Nha[j,i]end;
  895. if(i=9)and(Ba[i]=1)and(h2o<1)then begin
  896. N[i,j]:=Nha[i,j];N[j,i]:=Nha[j,i]end;
  897. { Nh '_' Hid Quiet Ln - NOT/OUT}
  898. if(i=8)and(Ba[i]=0)and(h1o<1)then begin
  899. N[i,j]:=Nh[i,j];N[j,i]:=Nh[j,i]end;
  900. if(i=9)and(Ba[i]=0)and(h2o<1)then begin
  901. N[i,j]:=Nh[i,j];N[j,i]:=Nh[j,i]end end;
  902. { N=0 '!' - Hidden Ln NOT/OUT}
  903. if Ih='!'then begin
  904. if(i=8)and(h1o<1)then begin
  905. N[i,j]:=0;N[j,i]:=0 end;
  906. if(i=9)and(h2o<1)then begin
  907. N[i,j]:=0;N[j,i]:=0 end end end;
  908.  
  909.  
  910. {Bso}for i:=1to b do Bso[i]:=Bs[i];
  911.  
  912.  
  913. {EARTH Branch CLASH : Sc,Oc u,v}
  914. Sc:=' ';Oc:=' ';u:=0;v:=0;
  915. for j:=1to b do for i:=1to b do
  916. if(i>j)or(i<j)then
  917. if((Hb[i]='b')and(Hb[j]='h')or
  918. (Hb[i]='e')and(Hb[j]='k')or
  919. (Hb[i]='h')and(Hb[j]='b')or
  920. (Hb[i]='k')and(Hb[j]='e'))and
  921. ((N[i,j]>0)or(N[j,i]>0))then begin
  922. Sc:=Hb[i];Oc:=Hb[j];u:=i;v:=j;
  923. if(i=Si)then Sc:='^';
  924. if(i=Oi)then Sc:=':';
  925. if(j=Si)then Oc:='^';
  926. if(j=Oi)then Oc:=':'end;
  927.  
  928. u0:=u;v0:=v;
  929.  
  930. {Brch COMBINE - SAc/OAc : S/O Act Comb}
  931. x:=0;y:=0;SAc:=' ';OAc:=' ';uv:='_';
  932. for i:=1to b do for j:=1to b do
  933. if(Hb[i]='a')and(Hb[j]='b')or
  934. (Hb[i]='c')and(Hb[j]='l')or
  935. (Hb[i]='d')and(Hb[j]='k')or
  936. (Hb[i]='e')and(Hb[j]='j')or
  937. (Hb[i]='f')and(Hb[j]='i')or
  938. (Hb[i]='g')and(Hb[j]='h')then begin
  939. if u>0then begin uv:='*';
  940. if(((i=u)or(i=v))and(Ba[j]=1))
  941. or(((j=u)or(j=v))and(Ba[i]=1))then
  942. begin u:=0;v:=0;uv:='~'end end;
  943. if i=Si then x:=j;if j=Si then x:=i;
  944. if i=Oi then y:=j;if j=Oi then y:=i;
  945. if(No[i,j]>0)or(No[j,i]>0)then begin
  946. if(i=Si)or(j=Si)then SAc:='^';
  947. if(i=Oi)or(j=Oi)then OAc:=':'end end;
  948.  
  949. {c1,c2,c3:S/O - Cb:x/y Date bind}
  950. c1:=' ';if x=Oi then c1:=' ';
  951. if Bb[Si]='~'then c1:='~';
  952. if(x>0)and((x>Oi)or(x<Oi))and(SAc='^')
  953. then c1:='!';
  954. if((x>0)and((x>Oi)or(x<Oi))and(SAc='^'))
  955. and (Bb[Si]='~')then c1:='#';
  956.  
  957. c3:=' ';if x=Oi then c3:=' ';
  958. if Bb[Oi]='~'then c3:='~';
  959. if(y>0)and((x>Oi)or(x<Oi))and(OAc=':')
  960. then c3:='!';
  961. if((y>0)and((x>Oi)or(x<Oi))and(OAc=':'))
  962. and(Bb[Oi]='~')then c3:='#';
  963.  
  964. {s1-s4: S/O/x/y Act Int Ind}
  965. s1:='_';s2:=' ';s3:='_';s4:='_';
  966. for i:=1to b do for j:=1to b do
  967. if(i>j)or(i<j)then begin
  968. if No[x,Oi]>0 then s1:=':';
  969. if No[Si,Oi]>0then s2:=':';
  970. if No[Si,y]>0 then s3:=':';
  971. if No[x,y]>0 then s4:=':'end;
  972.  
  973. if x>0then begin
  974. if((BMc[x]='*')or(BMc[Oi]='*'))
  975. and(s1='_')then s1:='*'end;
  976. if((BMc[Si]='*')or(BMc[Oi]='*'))
  977. and(s2=' ')then s2:='*';
  978. if y>0then begin
  979. if((BMc[Si]='*')or(BMc[y]='*'))
  980. and(s3='_')then s3:='*'end;
  981. if(x>0)and(y>0)then begin
  982. if((BMc[x]='*')or(BMc[y]='*'))
  983. and(s4='_')then s4:='*'end;
  984.  
  985. {u1/u2/u3/u4 : S/O/x/y Ml clash Ind}
  986. u1:=' ';u2:=' ';u3:=' ';u4:=' ';
  987. if BMc[x]='*' then u1:='*';
  988. if BMc[Si]='*'then u2:='*';
  989. if BMc[Oi]='*'then u3:='*';
  990. if BMc[y]='*' then u4:='*';
  991.  
  992. {Bei}
  993. for i:=0to 9do Bei[i]:=' ';
  994. for i:=1to b do begin
  995. if BMc[i]='*'then Bei[i]:='*';
  996. if DCe[i]='-'then Bei[i]:='-';
  997. if BDc[i]='|'then Bei[i]:='|';
  998. if BDc[i]='/'then Bei[i]:='/'end;
  999.  
  1000. {Gen/Con G/C}
  1001. for i:=1to b do begin G[i]:=0;C[i]:=0;
  1002. G0[i]:=1;C0[i]:=1 end;
  1003.  
  1004. for i:=1to b do for j:=1to b do
  1005. if(i>j)or(i<j)then begin
  1006. if Be[i]='W'then case(Be[j])of
  1007. 'F':G[i]:=G[i]+N[i,j];
  1008. 'E':C[i]:=C[i]+N[i,j]end;
  1009. if Be[i]='F'then case(Be[j])of
  1010. 'E':G[i]:=G[i]+N[i,j];
  1011. 'M':C[i]:=C[i]+N[i,j]end;
  1012. if Be[i]='E'then case(Be[j])of
  1013. 'M':G[i]:=G[i]+N[i,j];
  1014. 'w':C[i]:=C[i]+N[i,j]end;
  1015. if Be[i]='M'then case(Be[j])of
  1016. 'w':G[i]:=G[i]+N[i,j];
  1017. 'W':C[i]:=C[i]+N[i,j]end;
  1018. if Be[i]='w'then case(Be[j])of
  1019. 'W':G[i]:=G[i]+N[i,j];
  1020. 'F':C[i]:=C[i]+N[i,j]end end;
  1021.  
  1022. for i:=1to b do begin
  1023. Ng[i]:=0;Nc[i]:=0 end;
  1024.  
  1025. for i:=1to b do for j:=1to b do
  1026. if(i>j)or(i<j)then begin
  1027. if Be[i]='W'then case(Be[j])of
  1028. 'F':Ng[i]:=Ng[i]+1;
  1029. 'E':Nc[i]:=Nc[i]+1 end;
  1030. if Be[i]='F'then case(Be[j])of
  1031. 'E':Ng[i]:=Ng[i]+1;
  1032. 'M':Nc[i]:=Nc[i]+1 end;
  1033. if Be[i]='E'then case(Be[j])of
  1034. 'M':Ng[i]:=Ng[i]+1;
  1035. 'w':Nc[i]:=Nc[i]+1 end;
  1036. if Be[i]='M'then case(Be[j])of
  1037. 'w':Ng[i]:=Ng[i]+1;
  1038. 'W':Nc[i]:=Nc[i]+1 end;
  1039. if Be[i]='w'then case(Be[j])of
  1040. 'W':Ng[i]:=Ng[i]+1;
  1041. 'F':Nc[i]:=Nc[i]+1 end end;
  1042.  
  1043. for i:=1 to b do if Ng[i]>0 then
  1044. G[i]:=G[i]/Ng[i] else G[i]:=Ng[i];
  1045. for i:=1 to b do if Nc[i]>0 then
  1046. C[i]:=C[i]/Nc[i] else C[i]:=Nc[i];
  1047.  
  1048.  
  1049. if(Md='S')or(Md='M')then begin
  1050. if uv='~'then for i:=1to b do
  1051. if(i=u0)or(i=v0)then begin
  1052. G[i]:=G[i]/2;C[i]:=C[i]/2;
  1053. G0[i]:=0.5;C0[i]:=0.5 end;
  1054. if uv='*'then for i:=1to b do
  1055. if(i=u)or(i=v)then begin G[i]:=0;
  1056. C[i]:=0;G0[i]:=0;C0[i]:=0 end end;
  1057.  
  1058. if(Md='R')or(Md='L')then begin
  1059. if uv='*'then for i:=1to b do
  1060. if(i=u)or(i=v)then begin
  1061. G[i]:=G[i]/2;C[i]:=C[i]/2;
  1062. G0[i]:=0.5;C0[i]:=0.5 end end;
  1063.  
  1064.  
  1065. zF:=0; {Pi CYCLE}
  1066. zP:=0; G4: if kP>0then
  1067. for i:=1to b do Bs[i]:=RBd[i];
  1068. if Co='s'then if kP=0
  1069. then Oo:='o'else Oo:='n';
  1070. if Co='a'then Oo:='o';
  1071. if Co='C'then if(kP=0)or(kP=Pi-1)or(zP=1)
  1072. then Oo:='o'else Oo:='n';
  1073. if Co='O'then if(kP=0)or(kP=Pi-1)
  1074. then Oo:='o'else Oo:='n';
  1075. if Co='o'then if kP=Pi-1
  1076. then Oo:='o'else Oo:='n';
  1077. if Pi<3then Oo:='o';
  1078. if Co='n'then Oo:='n';
  1079.  
  1080.  
  1081. {ABs} G6: if zF=1then
  1082. for i:=1to b do Bs[i]:=ABs[i];
  1083.  
  1084.  
  1085. {Bg Bc Bd}
  1086. for i:=1to b do begin
  1087. Bg[i]:=0;Bc[i]:=0 end;
  1088.  
  1089. for i:=1to b do for j:=1to b do
  1090. if(i>j)or(i<j)then begin
  1091. if Be[i]='W'then case(Be[j])of
  1092. 'w':Bg[i]:=Bg[i]+(Bs[j]*N[i,j]*G0[j]);
  1093. 'M':Bc[i]:=Bc[i]+(Bs[j]*N[i,j]*C0[j])end;
  1094. if Be[i]='F'then case(Be[j])of
  1095. 'W':Bg[i]:=Bg[i]+(Bs[j]*N[i,j]*G0[j]);
  1096. 'w':Bc[i]:=Bc[i]+(Bs[j]*N[i,j]*C0[j])end;
  1097. if Be[i]='E'then case(Be[j])of
  1098. 'F':Bg[i]:=Bg[i]+(Bs[j]*N[i,j]*G0[j]);
  1099. 'W':Bc[i]:=Bc[i]+(Bs[j]*N[i,j]*C0[j])end;
  1100. if Be[i]='M'then case(Be[j])of
  1101. 'E':Bg[i]:=Bg[i]+(Bs[j]*N[i,j]*G0[j]);
  1102. 'F':Bc[i]:=Bc[i]+(Bs[j]*N[i,j]*C0[j])end;
  1103. if Be[i]='w'then case (Be[j])of
  1104. 'M':Bg[i]:=Bg[i]+(Bs[j]*N[i,j]*G0[j]);
  1105. 'E':Bc[i]:=Bc[i]+(Bs[j]*N[i,j]*C0[j])end
  1106. end;
  1107.  
  1108. {To STOP Int for ! Hid NOT/OUT}
  1109. for i:=1to b do e[i]:=1;
  1110. if Ih='!'then begin if h1o=0then e[8]:=0;
  1111. if h2o=0then e[9]:=0 end;
  1112.  
  1113. {Es Eg Ec}for i:=1to b do Es[i]:=0;
  1114. for i:=1to b do begin case(Be[i])of
  1115. 'W':Es[Wd]:=Es[Wd]+(Bs[i]*e[i]);
  1116. 'F':Es[Fr]:=Es[Fr]+(Bs[i]*e[i]);
  1117. 'E':Es[Er]:=Es[Er]+(Bs[i]*e[i]);
  1118. 'M':Es[Me]:=Es[Me]+(Bs[i]*e[i]);
  1119. 'w':Es[wt]:=Es[wt]+(Bs[i]*e[i])end end;
  1120.  
  1121. for i:=1to b do begin
  1122. Eg[i]:=0;Ec[i]:=0 end;
  1123. for i:=1to b do begin case(Be[i])of
  1124. 'W':Eg[Wd]:=Eg[Wd]+(Bs[i]*G[i]*e[i]);
  1125. 'F':Eg[Fr]:=Eg[Fr]+(Bs[i]*G[i]*e[i]);
  1126. 'E':Eg[Er]:=Eg[Er]+(Bs[i]*G[i]*e[i]);
  1127. 'M':Eg[Me]:=Eg[Me]+(Bs[i]*G[i]*e[i]);
  1128. 'w':Eg[wt]:=Eg[wt]+(Bs[i]*G[i]*e[i])end
  1129. end;
  1130. for i:=1to b do begin case(Be[i])of
  1131. 'W':Ec[Wd]:=Ec[Wd]+(Bs[i]*C[i]*e[i]);
  1132. 'F':Ec[Fr]:=Ec[Fr]+(Bs[i]*C[i]*e[i]);
  1133. 'E':Ec[Er]:=Ec[Er]+(Bs[i]*C[i]*e[i]);
  1134. 'M':Ec[Me]:=Ec[Me]+(Bs[i]*C[i]*e[i]);
  1135. 'w':Ec[wt]:=Ec[wt]+(Bs[i]*C[i]*e[i])end
  1136. end;
  1137. for i:=1to b do En[i]:=0;
  1138. for i:=1to b do begin case(Be[i])of
  1139. 'W':En[Wd]:=En[Wd]+(C[i]*e[i]);
  1140. 'F':En[Fr]:=En[Fr]+(C[i]*e[i]);
  1141. 'E':En[Er]:=En[Er]+(C[i]*e[i]);
  1142. 'M':En[Me]:=En[Me]+(C[i]*e[i]);
  1143. 'w':En[wt]:=En[wt]+(C[i]*e[i])end end;
  1144.  
  1145. {En0/Es0}if kP=0then begin
  1146. En0[1]:=0;Es0[0]:=0;
  1147. En0[1]:=En[Wd];En0[2]:=En[Fr];
  1148. En0[3]:=En[Er];En0[4]:=En[Me];
  1149. En0[5]:=En[wt];
  1150. Es0[1]:=Es[Wd];Es0[2]:=Es[Fr];
  1151. Es0[3]:=Es[Er];Es0[4]:=Es[Me];
  1152. Es0[5]:=Es[wt]end;
  1153. {He: Es0}for i:=1to 5do e[i]:=Es0[i];
  1154. e[0]:=e[1];m1:=1;for i:=2to 5do
  1155. if e[i]>e[0]then begin e[0]:=e[i];
  1156. m1:=i end;He:=Be[b+8+m1];
  1157.  
  1158.  
  1159. {Elm gen/con - Ig/Ic}
  1160. for i:=1to 20do begin
  1161. Ig[i]:=0;Ic[i]:=0 end;
  1162.  
  1163. Ig[1]:=Eg[5];Ig[3]:=Eg[2];Ig[5]:=Eg[4];
  1164. Ig[2]:=Eg[1];Ig[4]:=Eg[3];
  1165.  
  1166. Ic[1]:=Ec[4];Ic[3]:=Ec[1];Ic[5]:=Ec[3];
  1167. Ic[2]:=Ec[5];Ic[4]:=Ec[2];
  1168.  
  1169. {IgC/IcC % Es is gen/conq}
  1170. for i:=1to 5do IgC[i]:=0;
  1171. if Es[5]>0then IgC[1]:=Ig[1]/Es[5];
  1172. if Es[1]>0then IgC[2]:=Ig[2]/Es[1];
  1173. if Es[2]>0then IgC[3]:=Ig[3]/Es[2];
  1174. if Es[3]>0then IgC[4]:=Ig[4]/Es[3];
  1175. if Es[4]>0then IgC[5]:=Ig[5]/Es[4];
  1176.  
  1177. for i:=1to 5do IcC[i]:=0;
  1178. if Es[4]>0then IcC[1]:=Ic[1]/Es[4];
  1179. if Es[5]>0then IcC[2]:=Ic[2]/Es[5];
  1180. if Es[1]>0then IcC[3]:=Ic[3]/Es[1];
  1181. if Es[2]>0then IcC[4]:=Ic[4]/Es[2];
  1182. if Es[3]>0then IcC[5]:=Ic[5]/Es[3];
  1183.  
  1184. {RESULTANT VALUES CALCULATION}
  1185. for i:=1to 5do Es[i+5]:=Es[i];
  1186. for i:=1to 5do Ig[i+5]:=Ig[i];
  1187. for i:=1to 5do Ic[i+5]:=Ic[i];
  1188.  
  1189. Es[0]:=Es[1];m1:=1;for i:=2to 5do
  1190. if Es[i]>Es[0]then begin
  1191. Es[0]:=Es[i];m1:=i end;
  1192.  
  1193. {Es pos no}
  1194. if m1=1then begin
  1195. xS:=1;xP:=2;yW:=3;yP:=4;xG:=5 end;
  1196. if m1=2then begin
  1197. xS:=2;xP:=3;yW:=4;yP:=5;xG:=1 end;
  1198. if m1=3then begin
  1199. xS:=3;xP:=4;yW:=5;yP:=1;xG:=2 end;
  1200. if m1=4then begin
  1201. xS:=4;xP:=5;yW:=1;yP:=2;xG:=3 end;
  1202. if m1=5then begin
  1203. xS:=5;xP:=1;yW:=2;yP:=3;xG:=4 end;
  1204.  
  1205. Es[yW+5]:=Es[yW]-Ic[yW];if Es[yW+5]<0
  1206. then begin Ig[yP]:=0;Ic[xG]:=0 end;
  1207. if Es[yW+5]>0then begin
  1208. Ig[yP]:=Es[yW+5]*IgC[yP];
  1209. Ic[xG]:=Es[yW+5]*IcC[xG]end;
  1210.  
  1211. Es[xG+5]:=Es[xG]-Ic[xG];if Es[xG+5]<0
  1212. then begin Ig[xS]:=0;Ic[xP]:=0 end;
  1213. if Es[xG+5]>0then begin
  1214. Ig[xS]:=Es[xG+5]*IgC[xS];
  1215. Ic[xP]:=Es[xG+5]*IcC[xP]end;
  1216.  
  1217. Es[xP+5]:=Es[xP]-Ic[xP];if Es[xP+5]<0
  1218. then begin Ig[yW]:=0;Ic[yP]:=0 end;
  1219. if Es[xP+5]>0then begin
  1220. Ig[yW]:=Es[xP+5]*IgC[yW];
  1221. Ic[yP]:=Es[xP+5]*IcC[yP]end;
  1222.  
  1223. Es[yP+5]:=Es[yP]-Ic[yP];if Es[yP+5]<0
  1224. then begin Ig[xG]:=0;Ic[xS]:=0 end;
  1225. if Es[yP+5]>0then begin
  1226. Ig[xG]:=Es[yP+5]*IgC[xG];
  1227. Ic[xS]:=Es[yP+5]*IcC[xS]end;
  1228.  
  1229. Es[xS+5]:=Es[xS]-Ic[xS];if Es[xS+5]<0
  1230. then begin Ig[xP]:=0;Ic[yW]:=0 end;
  1231. if Es[xS+5]>0then begin
  1232. Ig[xP]:=Es[xS+5]*IgC[xP];
  1233. Ic[yW]:=Es[xS+5]*IcC[yW]end;
  1234.  
  1235.  
  1236. {FINAL RESULTANT CAL}
  1237. for i:=1to 5do Fs[i]:=0;
  1238. for i:=1to 5do Fs[i]:=Ig[i];
  1239. for i:=1to 5do Es[i+5]:=Es[i+5]+Fs[i];
  1240.  
  1241. for i:=1to 5do
  1242. if(Es[i+5]<0)or(Ig[i]=0)then Fs[i]:=0;
  1243. for i:=1to 5do
  1244. if Es[i+5]>0then if Es[i+5]<Fs[i]
  1245. then Fs[i]:=Es[i+5];
  1246.  
  1247. Es[7]:= Es[7]+(Fs[1]*IgC[2]);
  1248. Es[8]:= Es[8]-(Fs[1]*IcC[3]);
  1249. Es[8]:= Es[8]+(Fs[2]*IgC[3]);
  1250. Es[9]:= Es[9]-(Fs[2]*IcC[4]);
  1251. Es[9]:= Es[9]+(Fs[3]*IgC[2]);
  1252. Es[10]:=Es[10]-(Fs[3]*IcC[3]);
  1253. Es[10]:=Es[10]+(Fs[4]*IgC[2]);
  1254. Es[6]:= Es[6]-(Fs[4]*IcC[3]);
  1255. Es[6]:= Es[6]+(Fs[5]*IgC[2]);
  1256. Es[7]:= Es[7]-(Fs[5]*IcC[3]);
  1257.  
  1258. if Es[6]<0then begin
  1259. Ig[2]:=0;Ic[3]:=0 end;
  1260. if Es[7]<0then begin
  1261. Ig[3]:=0;Ic[4]:=0 end;
  1262. if Es[8]<0then begin
  1263. Ig[4]:=0;Ic[5]:=0 end;
  1264. if Es[9]<0then begin
  1265. Ig[5]:=0;Ic[1]:=0 end;
  1266. if Es[10]<0then begin
  1267. Ig[1]:=0;Ic[2]:=0 end;
  1268.  
  1269. for i:=1to 5do
  1270. if(Es[i+5]<0)or(Ig[i]=0)then Fs[i]:=0;
  1271. for i:=1to 5do
  1272. if Es[i+5]>0then if Es[i+5]<Fs[i]
  1273. then Fs[i]:=Es[i+5];
  1274.  
  1275. if Es[6]>0then begin
  1276. Ig[2]:=Ig[2]+(Fs[1]*IgC[2]);
  1277. Ic[3]:=Ic[3]+(Fs[1]*IcC[3])end;
  1278. if Es[7]>0then begin
  1279. Ig[3]:=Ig[3]+(Fs[2]*IgC[3]);
  1280. Ic[4]:=Ic[4]+(Fs[2]*IcC[4])end;
  1281. if Es[8]>0then begin
  1282. Ig[4]:=Ig[4]+(Fs[3]*IgC[4]);
  1283. Ic[5]:=Ic[5]+(Fs[3]*IcC[5])end;
  1284. if Es[9]>0then begin
  1285. Ig[5]:=Ig[5]+(Fs[4]*IgC[5]);
  1286. Ic[1]:=Ic[1]+(Fs[4]*IcC[1])end;
  1287. if Es[10]>0then begin
  1288. Ig[1]:=Ig[1]+(Fs[5]*IgC[1]);
  1289. Ic[2]:=Ic[2]+(Fs[5]*IcC[2])end;
  1290.  
  1291. for i:=1to 5do
  1292. Es[i+5]:=(Es[i]+(Ig[i]))-Ic[i];
  1293.  
  1294.  
  1295. {RBc RBg RBd}
  1296. for i:=1to 9do begin RBd[i]:=0;
  1297. RBc[i]:=Bc[i];RBg[i]:=Bg[i]end;
  1298. for i:=1to b do begin
  1299. if Ic[Bp[i]+5]=0then RBc[i]:=0 else
  1300. RBc[i]:=(RBc[i]*Ic[Bp[i]])/Ic[Bp[i]+5];
  1301. if Ig[Bp[i]+5]=0then RBg[i]:=0 else
  1302. RBg[i]:=(RBg[i]*Ig[Bp[i]])/Ig[Bp[i]+5]
  1303. end;for i:=1to b do
  1304. RBd[i]:=(Bs[i]+(RBg[i]))-RBc[i];
  1305.  
  1306. if on='n'then begin
  1307. for i:=1to b do e[i]:=RBd[i];
  1308. e[0]:=e[1];m1:=1;for i:=2to b do if
  1309. e[i]>e[0]then begin e[0]:=e[i];m1:=i end;
  1310. e[0]:=e[1];m2:=1;for i:=2to b do if
  1311. e[i]<e[0]then begin e[0]:=e[i];m2:=i end;
  1312. 3:repeat for i:=1to b do e[i]:=e[i]/2;
  1313. until (e[m1]<=0.1)and(e[m2]>=-0.1);
  1314. for i:=1to b do RBd[i]:=e[i]*4 end;
  1315.  
  1316. if(on='z')then begin
  1317. RBd[0]:=RBd[1];m1:=1;for i:=2to b do
  1318. if RBd[i]<RBd[0]then begin
  1319. RBd[0]:=RBd[i];m1:=i end;
  1320. RBd[0]:=RBd[m1];if RBd[0]<0then begin
  1321. RBd[0]:=RBd[0]-(RBd[0]*2);
  1322. for i:=1to b do RBd[i]:=RBd[i]+RBd[0]end;
  1323. RBd[0]:=0;
  1324. for i:=1to b do RBd[0]:=RBd[0]+RBd[i];
  1325. for i:=1to b do
  1326. RBd[i]:=(((RBd[i]*100)/RBd[0]))/100 end;
  1327.  
  1328.  
  1329. {RBP}for i:=1to b do PN[i]:=' ';
  1330. for i:=1to b do begin if Bs[i]>0then
  1331. RBP[i]:=((RBd[i]*10)/(Bs[i]))-10;
  1332. if(RBd[i]-Bs[i])<0then begin PN[i]:='-';
  1333. RBP[i]:=((RBd[i]*10)/(Bs[i]))-10;
  1334. if RBP[i]<0then
  1335. RBP[i]:=RBP[i]-(RBP[i]*2)end;
  1336. if RBP[i]>99then RBP[i]:=99;
  1337. if Bs[i]=RBd[i]then RBP[i]:=0 end;
  1338.  
  1339.  
  1340. case(Hb[Si])of
  1341. 'a':Sf:='A';'b':Sf:='B';'c':Sf:='C';
  1342. 'd':Sf:='D';'e':Sf:='E';'f':Sf:='F';
  1343. 'g':Sf:='G';'h':Sf:='H';'i':Sf:='I';
  1344. 'j':Sf:='J';'k':Sf:='K';'l':Sf:='L'end;
  1345.  
  1346. {Ts}for i:=1to 5do Ts[i]:=0;
  1347. for i:=1to b do RBo[i]:=RBd[i];
  1348. for i:=1to b do
  1349. if RBo[i]<0then RBo[i]:=0;
  1350. for i:=1to b do case(Be[i])of
  1351. 'W':Ts[1]:=Ts[1]+RBo[i];
  1352. 'F':Ts[2]:=Ts[2]+RBo[i];
  1353. 'E':Ts[3]:=Ts[3]+RBo[i];
  1354. 'M':Ts[4]:=Ts[4]+RBo[i];
  1355. 'w':Ts[5]:=Ts[5]+RBo[i]end;
  1356. {TsA}for i:=1to 5do AEl[i]:=' ';
  1357. for i:=1to b do begin
  1358. a:=Bei[i];if(i=Mi)or(i=7)then a:='-';
  1359. if(Be[i]='W')and(Ba[i]=1)then AEl[1]:=a;
  1360. if(Be[i]='F')and(Ba[i]=1)then AEl[2]:=a;
  1361. if(Be[i]='E')and(Ba[i]=1)then AEl[3]:=a;
  1362. if(Be[i]='M')and(Ba[i]=1)then AEl[4]:=a;
  1363. if(Be[i]='w')and(Ba[i]=1)then AEl[5]:=a
  1364. end;
  1365. {Te: Ts}for i:=1to 5do e[i]:=Ts[i];
  1366. e[0]:=e[1];m1:=1;for i:=2to 5do
  1367. if e[i]>e[0]then begin
  1368. e[0]:=e[i];m1:=i end;Te:=Be[b+8+m1];
  1369.  
  1370.  
  1371. {RBs RBm}if zP=0 then
  1372. for i:=1to 9do RBs[i]:=0;
  1373. for i:=1to 9do RBs[i]:=RBs[i]+RBd[i];
  1374. if zP>0 then
  1375. for i:=1to 9do RBm[i]:=RBs[i]/(zP+1);
  1376. {TsS TsM}if zP=0then
  1377. for i:=1to 5do TsS[i]:=0;
  1378. for i:=1to b do if RBm[i]<0then
  1379. RBo[i]:=0 else RBo[i]:=RBm[i];
  1380. for i:=1to b do case(Be[i])of
  1381. 'W':TsS[1]:=TsS[1]+RBo[i];
  1382. 'F':TsS[2]:=TsS[2]+RBo[i];
  1383. 'E':TsS[3]:=TsS[3]+RBo[i];
  1384. 'M':TsS[4]:=TsS[4]+RBo[i];
  1385. 'w':TsS[5]:=TsS[5]+RBo[i]end;
  1386. if zP>0 then
  1387. for i:=1to 5do TsM[i]:=TsS[i]/(zP+1);
  1388. {Se: TsM}for i:=1to 5do e[i]:=TsM[i];
  1389. e[0]:=e[1];m1:=1;for i:=2to 5do
  1390. if e[i]>e[0]then begin e[0]:=e[i];
  1391. m1:=i end;Se:=Be[b+8+m1];
  1392.  
  1393. {RBa}if(zP=Pi-1)then begin case(ET)of
  1394. 'E':for i:=1to b do e[i]:=Bso[i];
  1395. 'T':for i:=1to b do e[i]:=RBd[i];
  1396. 'M':for i:=1to b do e[i]:=RBm[i]end;
  1397. for i:=1to b do eW[i]:=e[i];
  1398. for i:=1to b do for j:=1to b do
  1399. if(i>j)or(i<j)then
  1400. if(BR[i,j]='>')and(Ba[i]=1)then
  1401. if e[i]<0then e[i]:=e[j]*N[i,j]*G0[j]
  1402. else e[i]:=e[i]+e[j]*N[i,j]*G0[j];
  1403. for i:=1to b do for j:=1to b do
  1404. if(i>j)or(i<j)then
  1405. if(BR[i,j]='>')and(Ba[j]=1)then
  1406. if e[i]<0then e[i]:=e[j]*N[i,j]*G0[j]
  1407. else e[i]:=e[i]+e[j]*N[i,j]*G0[j];
  1408. for i:=1to b do RBa[i]:=e[i];
  1409. {RBr}for i:=1to b do
  1410. RBr[i]:=RBa[i]-eW[i];if Cl=':'then
  1411. for i:=1to b do RBa[i]:=RBr[i];
  1412. {TsA}for i:=1to 5do TsA[i]:=0;
  1413. for i:=1to b do if RBa[i]<0then
  1414. RBo[i]:=0 else RBo[i]:=RBa[i];
  1415. for i:=1to b do case(Be[i])of
  1416. 'W':TsA[1]:=TsA[1]+RBo[i];
  1417. 'F':TsA[2]:=TsA[2]+RBo[i];
  1418. 'E':TsA[3]:=TsA[3]+RBo[i];
  1419. 'M':TsA[4]:=TsA[4]+RBo[i];
  1420. 'w':TsA[5]:=TsA[5]+RBo[i]end;
  1421. {Ae: TsA}for i:=1to 5do e[i]:=TsA[i];
  1422. e[0]:=e[1];m1:=1;for i:=2to 5do
  1423. if e[i]>e[0]then begin e[0]:=e[i];
  1424. m1:=i end;Ae:=Be[b+8+m1]end;
  1425.  
  1426.  
  1427. {ABs}if zF=0then begin
  1428. for i:=1to b do ABs[i]:=ABs[i]+RBd[i];
  1429. if zP>2then if zP=Pi-1 then begin
  1430. for i:=1to b do ABs[i]:=ABs[i]/Pi;
  1431. zF:=1; goto G6 end end;
  1432.  
  1433.  
  1434. if(zF=1)or(zP=Pi-1)then begin
  1435.  
  1436. {EcR/WgP PREDICTION CALCULATION}
  1437. if ET='E'then for i:=1to 5do begin
  1438. e[i]:=Es0[i];eW[i]:=Es0[i];a:=He end;
  1439. if ET='T'then for i:=1to 5do begin
  1440. e[i]:=Ts[i];eW[i]:=Ts[i];a:=Te end;
  1441. if ET='M'then for i:=1to 5do begin
  1442. e[i]:=TsM[i];eW[i]:=TsM[i];a:=Se end;
  1443. if oa=':'then for i:=1to 5do begin
  1444. e[i]:=TsA[i];eW[i]:=TsA[i];a:=Ae end;
  1445. {ET - Es0/Ts/TsM pos no}
  1446. if a='W'then begin
  1447. xS:=1;xP:=2;yW:=3;yP:=4;xG:=5 end;
  1448. if a='F'then begin
  1449. xS:=2;xP:=3;yW:=4;yP:=5;xG:=1 end;
  1450. if a='E'then begin
  1451. xS:=3;xP:=4;yW:=5;yP:=1;xG:=2 end;
  1452. if a='M'then begin
  1453. xS:=4;xP:=5;yW:=1;yP:=2;xG:=3 end;
  1454. if a='w'then begin
  1455. xS:=5;xP:=1;yW:=2;yP:=3;xG:=4 end;
  1456. {EcT/EcR : ET conq/Res ET}
  1457. EcT[1]:=e[4]*En0[4];
  1458. EcT[2]:=e[5]*En0[5];
  1459. EcT[3]:=e[1]*En0[1];
  1460. EcT[4]:=e[2]*En0[2];
  1461. EcT[5]:=e[3]*En0[3];
  1462. for i:=1to 5do
  1463. if EcT[i]<=0then EcT[i]:=0;
  1464. for i:=1to 5 do EcR[i]:=e[i]-EcT[i];
  1465. for i:=1to 5 do ETx[i]:=e[i];
  1466. {FINAL CALCULATION - Int Adj}
  1467. if EcR[yW]<=0then EcT[xG]:=0;
  1468. if e[xG]<eW[xG]then ETx[xG]:=eW[xG];
  1469. if(ETx[yW]-EcT[yW])>0then
  1470. EcT[xP]:=(ETx[xG]-EcT[xG])*En0[xG];
  1471.  
  1472. if EcR[xP]<=0then EcT[yP]:=0;
  1473. if e[yP]<eW[yP]then ETx[yP]:=eW[yP];
  1474. if(ETx[xP]-EcT[xP])>0then
  1475. EcT[yP]:=(ETx[xP]-EcT[xP])*En0[xP];
  1476. if(ETx[yP]-EcT[yP])>0then
  1477. EcT[xS]:=(ETx[yP]-EcT[yP])*En0[yP];
  1478.  
  1479. for i:=1to 5do
  1480. if EcT[i]<=0then EcT[i]:=0;
  1481. for i:=1to 5do EcR[i]:=ETx[i]-EcT[i];
  1482.  
  1483. {Re: EcR}for i:=1to 5do e[i]:=EcR[i];
  1484. e[0]:=e[1];m1:=1;for i:=2to 5do
  1485. if e[i]>e[0]then begin e[0]:=e[i];
  1486. m1:=i end;Re:=Be[b+8+m1]{zF=1}end;
  1487.  
  1488. for i:=1to 5do EcR[i+5]:=EcR[i];
  1489. for i:=1to 10do e[i]:=EcR[i];
  1490. {Wg/WgP}if Gn='r'then
  1491. for i:=1to 5do Wg[i]:=EcR[i]else begin
  1492. if oa=':'then
  1493. for i:=1to 5do Wg[i]:=TsA[i]else
  1494. case(ET)of
  1495. 'E':for i:=1to 5do Wg[i]:=Es0[i];
  1496. 'T':for i:=1to 5do Wg[i]:=Ts[i];
  1497. 'M':for i:=1to 5do Wg[i]:=TsM[i]end end;
  1498. for i:=1to 5do Wg[i+5]:=Wg[i];
  1499.  
  1500. for i:=1to 10do e[i]:=Wg[i];
  1501. if Aa='_'then for i:=1to 10do
  1502. if Wg[i]<=0then e[i]:=0;
  1503.  
  1504. eW[1]:=e[5]-e[4];eW[4]:=e[3]-e[2];
  1505. eW[2]:=e[1]-e[5];eW[5]:=e[4]-e[3];
  1506. eW[3]:=e[2]-e[1];
  1507. e[1]:=(eW[2]-eW[4])+(eW[3]-eW[5]);
  1508. e[2]:=(eW[3]-eW[5])+(eW[4]-eW[1]);
  1509. e[3]:=(eW[4]-eW[1])+(eW[5]-eW[2]);
  1510. e[4]:=(eW[5]-eW[2])+(eW[1]-eW[3]);
  1511. e[5]:=(eW[1]-eW[3])+(eW[2]-eW[4]);
  1512. for i:=1to 5do TmR[i]:=e[i];
  1513. for i:=1to 5do e[i+5]:=e[i];
  1514. WgP:={e[Ep[Si]+4]+}e[Ep[Si]+1]
  1515. -e[Ep[Si]+3];
  1516. Pw:='_';
  1517. if WgP>0then Pw:='<';
  1518. if WgP<0then Pw:='>';
  1519.  
  1520.  
  1521. {Results HEADING}
  1522. if(Cs='r')and(z=0)and(kT=0)then begin
  1523. for i:=1 to Cw-1 do Write(Wn[i],' ');
  1524. if Wn[1]=0then Write('o ')else
  1525. Write(' - ');Write('(',An,')');
  1526. if Cj<0then Write(Cj);Writeln(' ')end;
  1527.  
  1528. {kT/kR/pT/B1/2}k:=Ns+z;kT:=k;kR:=Rn[z+1];
  1529. if(WgP>0)and(T[k]='1')then T[k]:='R';
  1530. if(WgP>0)and(T[k]='2')then T[k]:='b';
  1531. if(WgP<0)and(T[k]='2')then T[k]:='B';
  1532. if(WgP<0)and(T[k]='1')then T[k]:='r';
  1533. B1:=B0;B2:=B0;
  1534. if T[k]='R'then begin B1:='o';B2:=' 'end;
  1535. if T[k]='r'then begin B1:='x';B2:=' 'end;
  1536. if T[k]='B'then begin B2:='o';B1:=' 'end;
  1537. if T[k]='b'then begin B2:='x';B1:=' 'end;
  1538. if T[k]='x'then begin B2:='X';B1:='X'end;
  1539. if Cs='r'then begin
  1540. if Wn[1]>0then begin
  1541. if Wn[1]=kR then B1:='o';
  1542. if Wn[2]=kR then B1:='*';
  1543. if Wn[3]=kR then B1:='(';
  1544. if Wn[4]=kR then B1:='[';
  1545. if(B1=B0)then B1:=' 'end;
  1546. if(T[Rn[k]]>T0)or(T[Rn[k]]<T0)
  1547. then B2:=T[Rn[k]]else
  1548. if(B2=B0)and(Wn[1]>0)then B2:=' 'end;
  1549. k:=z+1;
  1550. if(T[kT]>T0)or(T[kT]<T0)then pT:=k;
  1551. if pT>Sk then pT:=Sk;
  1552.  
  1553. if zP=0then if Wn[1]=kR then
  1554. begin Wo[1]:=Mo[kT];Wo[kT]:=Mo[1]end;
  1555.  
  1556.  
  1557. {TsA/Pm}if(Pm[3]='-')and(Rr='o')
  1558. and(zu<3)and(PmL='o')then begin
  1559. if zP=1 then begin Write(' ');
  1560. for i:=1to 5do begin
  1561. if i=Ep[Si]then Write('.',AEl[i],'.')else
  1562. Write(' ',AEl[i],' ')end;Writeln end;
  1563. k:=-1;
  1564. case(Pm[1])of'8':k:=3141;'9':k:=16180;
  1565. '1':k:=11;'2':k:=31;'3':k:=61;'4':k:=161;
  1566. '5':k:=314;'6':k:=618;'7':k:=1618 end;
  1567. for i:=1to 9do Pc[i]:=-1;
  1568. if Pm[5]>='1'then Pc[1]:=11;
  1569. if Pm[5]>='2'then Pc[2]:=31;
  1570. if Pm[5]>='3'then Pc[3]:=61;
  1571. if Pm[5]>='4'then Pc[4]:=161;
  1572. if Pm[5]>='5'then Pc[5]:=314;
  1573. if Pm[5]>='6'then Pc[6]:=618;
  1574. if Pm[5]>='7'then Pc[7]:=1618;
  1575. if Pm[5]>='8'then Pc[8]:=3141;
  1576. if Pm[5]>='9'then Pc[9]:=16180;
  1577. if(zP=Pc[1])or(zP=Pc[4])or(zP=Pc[7])
  1578. or(zP=Pc[2])or(zP=Pc[5])or(zP=Pc[8])
  1579. or(zP=Pc[3])or(zP=Pc[6])or(zP=Pc[9])
  1580. or((zP>0)and(zP<k))or(zP=Pi-1)then begin
  1581. if ET='E'then begin a:='o';
  1582. for i:=1to 5do e[i]:=Es0[i]*mc end;
  1583. if ET='T'then begin a:='s';
  1584. for i:=1to 5do e[i]:=Ts[i]*mc end;
  1585. if ET='M'then begin a:='m';
  1586. for i:=1to 5do e[i]:=TsM[i]*mc end;
  1587. case(a)of'o':Write(He,'-');
  1588. 's':Write(Te,':');'m':Write(Se,'.')end;
  1589. Write(' ');for i:=1to 5do begin
  1590. if(e[i]>0)and(e[i]<0.95)then
  1591. Write('<',(e[i]*10):0:0,' ')else begin
  1592. if e[i]>=0then Write(' ');
  1593. if(e[i]<9.5)and(e[i]>=0)
  1594. then Write(e[i]:0:0,' ');
  1595. if(e[i]>9.5)and(e[i]>=0)
  1596. then Write(e[i]:0:0);
  1597. if(e[i]>-9.5)and(e[i]<0)
  1598. then Write(e[i]:0:0,' ');
  1599. if(e[i]<-9.5)then Write(e[i]:0:0);
  1600. end end;Writeln(' ',zP,' ')end;
  1601. if(zP=0)and(z>0)then Writeln end;
  1602.  
  1603. {Rw/Xw}Rw:=0;for i:=1to 99do if Wh[i]=
  1604. Mo[kT]then begin Rw:=i;Xw[kT]:=Rw end;
  1605.  
  1606.  
  1607. if(zu>1)and(zP=0)and(zr=1)and(kT>1)then
  1608. Writeln;if(Rr='R')or(Rr='r')or(Oo='n')
  1609. then goto G5;
  1610. {OUTPUT 0}Pw:='_';
  1611. if WgP>0then Pw:='<';
  1612. if WgP<0then Pw:='>';
  1613. if Md<='S'then begin Write(Yr-2000);
  1614. if Mt>9then Write(Mt)else Write('0',Mt);
  1615. if Dy>9then Write(Dy)else Write('0',Dy);
  1616. Write(I4[zr],I5[zr],I6[zr],'___',Pw);
  1617. if Rw=0then Write('__')else if Rw>9then
  1618. Write(Rw)else Write(Rw,'_');Write('___');
  1619. if Mo[kT]>9then
  1620. Write(Mo[kT])else Write('_',Mo[kT]);
  1621.  
  1622. if Is='.'then begin Write('__');
  1623. for i:=1to b do e[i]:=RBr[i]*mc;
  1624. for i:=1to 5do begin if i=h1 then begin
  1625. if(e[8]>0)and(e[8]<0.95)then
  1626. Write('<',(e[8]*10):0:0,'_')else begin
  1627. if e[8]<0then begin
  1628. if e[8]<=-9.5then Write(e[8]:0:0);
  1629. if e[8]>-9.5then Write(e[8]:0:0,'_')end;
  1630. if e[8]>=0then begin
  1631. if e[8]<9.5then Write(' ',e[8]:0:0,'_');
  1632. if e[8]>=9.5then
  1633. Write(' ',e[8]:0:0)end end end;
  1634. if i=h2 then begin
  1635. if(e[9]>0)and(e[9]<0.95)then
  1636. Write('<',(e[9]*10):0:0,'_')else begin
  1637. if e[9]<0 then begin
  1638. if e[9]<=-9.5then Write(e[9]:0:0);
  1639. if e[9]>-9.5then Write(e[9]:0:0,'_')end;
  1640. if e[9]>=0then begin
  1641. if e[9]<9.5then Write(' ',e[9]:0:0,'_');
  1642. if e[9]>=9.5then
  1643. Write(' ',e[9]:0:0)end end end;
  1644. if Hel[i]=' 'then Write('___')end end;
  1645. if Is='^'then for i:=1to 17do Write('_');
  1646. Writeln('_',I8[zr],Po,Pe);
  1647.  
  1648. {1}for i:=5to 8do if Db[i]='o'
  1649. then Write(' ')else Write(Db[i],' ');
  1650.  
  1651. if Wn[1]>0then B2:=' 'else B2:='.';
  1652. Write(' ',B1,' ',(10*H)+L,' ',B2,' ');
  1653.  
  1654. if u0>0then begin
  1655. r:=(RBd[u0]-RBd[v0])*100;
  1656. if r>=99.5then r:=99;
  1657. if r<=-99.5then r:=-99;Write(Sc);
  1658. if r<0then begin
  1659. if r<=-9.5then Write(r:0:0);
  1660. if r>-9.5then Write(r:0:0,' ')end;
  1661. if r>=0then begin
  1662. if r<9.5then Write(' ',r:0:0,' ');
  1663. if r>=9.5then Write(' ',r:0:0)end;
  1664. Write(Oc)end;
  1665. if u0=0then Write('___',uv,'_');
  1666.  
  1667. if oa=':'then
  1668. for i:=1to b do e[i]:=RBa[i]*mc else
  1669. case(ET)of
  1670. 'E':for i:=1to b do e[i]:=Bso[i]*mc;
  1671. 'T':for i:=1to b do e[i]:=RBd[i]*mc;
  1672. 'M':for i:=1to b do e[i]:=RBm[i]*mc end;
  1673. for i:=1to b do if(e[i]>-0.000000000001)
  1674. and(e[i]<=0.000000000001)then e[i]:=0;
  1675. for i:=1to 5do begin if i=h1 then begin
  1676. if(e[8]>0)and(e[8]<0.95)then
  1677. Write('<',(e[8]*10):0:0,'_')else begin
  1678. if e[8]<0then begin
  1679. if e[8]<=-9.5then Write(e[8]:0:0);
  1680. if e[8]>-9.5then Write(e[8]:0:0,'_')end;
  1681. if e[8]>=0then begin
  1682. if e[8]<9.5then Write(' ',e[8]:0:0,'_');
  1683. if e[8]>=9.5then
  1684. Write(' ',e[8]:0:0)end end end;
  1685. if i=h2 then begin
  1686. if(e[9]>0)and(e[9]<0.95)then
  1687. Write('<',(e[9]*10):0:0,'_')else begin
  1688. if e[9]<0 then begin
  1689. if e[9]<=-9.5then Write(e[9]:0:0);
  1690. if e[9]>-9.5then Write(e[9]:0:0,'_')end;
  1691. if e[9]>=0then begin
  1692. if e[9]<9.5then Write(' ',e[9]:0:0,'_');
  1693. if e[9]>=9.5then
  1694. Write(' ',e[9]:0:0)end end end;
  1695. if Hel[i]=' ' then Write('___')end;
  1696.  
  1697. {2}Writeln('__',Vd);
  1698. for i:=1to 4do if Db[i]='o'then
  1699. Write(' ')else Write(Db[i],' ');
  1700. Write(' ');
  1701. if x=Oi then Write('___|___ ')else begin
  1702. if(x=0)and(y=0)then Write('_______ ')
  1703. else Write(s1,'__',s4,'__',s3,' ')end;
  1704. if uv='~'then Write(' ',uv,' ')
  1705. else Write(' ');
  1706.  
  1707. for i:=1to 5do begin
  1708. if i=h1 then Write(Hol[8],Hb[8],Bei[8]);
  1709. if i=h2 then Write(Hol[9],Hb[9],Bei[9]);
  1710. if Hel[i]=' 'then Write(' ')end;
  1711.  
  1712. {3}Writeln;if Cl=':'then Write(':')
  1713. else Write(' ');Write(I7[zr],' ');
  1714.  
  1715. if(x=Oi)or(x=0)then Write(' ')else
  1716. if x>0then Write(u1,Hb[x],' ');
  1717. Write(c1,Sf,u2,' ',BR[Si,Oi],' ',
  1718. u3,Hb[Oi],c3,' ');
  1719. if(x=Oi)or(y=0)then Write(' ')else
  1720. if y>0then Write(Hb[y],u4,' ');
  1721.  
  1722. for i:=1to 6do begin
  1723. if i=Si then Write('(',Sf,Bei[i])else
  1724. if i=Oi then Write('•',Hb[i],Bei[i])
  1725. else Write(' ',Hb[i],Bei[i])end;Writeln;
  1726.  
  1727. {4}if Cs='r'then k:=kR else k:=kT;
  1728. if k<=9then Write('(',k,') ');
  1729. if(k>9)and(k<=99)then Write(k,') ');
  1730. if k>99then Write(k,')');
  1731.  
  1732. if(x=Oi)or(x=0)then Write(' ')else
  1733. if x>0then begin Write(' ');
  1734. if e[x]<0then begin
  1735. if e[x]<=-9.5then Write(e[x]:0:0);
  1736. if e[x]>-9.5then Write(e[x]:0:0,' ')end;
  1737. if e[x]>=0then begin
  1738. if e[x]<9.5then Write(' ',e[x]:0:0,' ');
  1739. if e[x]>=9.5then Write(' ',e[x]:0:0)end
  1740. end;
  1741. if e[Si]<0then begin
  1742. if e[Si]<=-9.5then Write(e[Si]:0:0);
  1743. if e[Si]>-9.5then Write(e[Si]:0:0,' ')
  1744. end;
  1745. if e[Si]>=0then begin if e[Si]<9.5then
  1746. Write(' ',e[Si]:0:0,' ');
  1747. if e[Si]>=9.5then Write(' ',e[Si]:0:0)
  1748. end;Write(' ',s2,' ');
  1749. if e[Oi]<0then begin if e[Oi]<=-9.5
  1750. then Write(e[Oi]:0:0);if e[Oi]>-9.5
  1751. then Write(e[Oi]:0:0,' ')end;
  1752. if e[Oi]>=0then begin if e[Oi]<9.5then
  1753. Write(' ',e[Oi]:0:0,' ');if e[Oi]>=9.5
  1754. then Write(' ',e[Oi]:0:0)end;
  1755.  
  1756. if x=Oi then Write(' ')else
  1757. if y>0then begin if e[y]<0then begin
  1758. if e[y]<=-9.5then Write(e[y]:0:0);
  1759. if e[y]>-9.5then Write(e[y]:0:0,' ')end;
  1760. if e[y]>=0then begin
  1761. if e[y]<9.5then Write(' ',e[y]:0:0,' ');
  1762. if e[y]>=9.5then
  1763. Write(' ',e[y]:0:0)end end;
  1764.  
  1765. if y=0then Write(' ');Write(' ');
  1766.  
  1767. for i:=1to 5do if i=Mi then
  1768. Write(Hb[7],Bei[7],' ')else Write(' ');
  1769. if 6=Mi then Write(Hb[7],Bei[7])
  1770. else Write(' ');
  1771.  
  1772. {5}Writeln;
  1773. if Ih='_'then Write(' ')else Write(Ih);
  1774. Write(' ');
  1775. if Ie='*'then Write(' ')else Write(Ie);
  1776. if(x=Oi)or(x=0)then Write(' ')
  1777. else if x>0then begin Write(' ');
  1778. if(RBP[x]>=0)and(RBP[x]<9.5)
  1779. then Write(PN[x],RBP[x]:0:0,' ');
  1780. if(RBP[x]>=9.5)and(RBP[x]<=99.5)
  1781. then Write(PN[x],RBP[x]:0:0)end;
  1782.  
  1783. if(RBP[Si]>=0)and(RBP[Si]<9.5)
  1784. then Write(PN[Si],RBP[Si]:0:0,' ');
  1785. if(RBP[Si]>=9.5)and(RBP[Si]<=99.5)
  1786. then Write(PN[Si],RBP[Si]:0:0);
  1787. r:=(e[Si]-e[Oi])*10;
  1788. if r>=99.5then r:=99;
  1789. if r<=-99.5then r:=-99;
  1790. if r<0then begin
  1791. if r<=-9.5then Write(r:0:0);
  1792. if r>-9.5then Write(r:0:0,' ')end;
  1793. if r>=0then begin
  1794. if r<9.5then Write(' ',r:0:0,' ');
  1795. if r>=9.5 then Write(' ',r:0:0)end;
  1796. if(RBP[Oi]>=0)and(RBP[Oi]<9.5)
  1797. then Write(PN[Oi],RBP[Oi]:0:0,' ');
  1798. if(RBP[Oi]>=9.5)and(RBP[Oi]<=99.5)
  1799. then Write(PN[Oi],RBP[Oi]:0:0);
  1800.  
  1801. if x=Oi then Write(' ')else
  1802. if y>0 then begin
  1803. if(RBP[y]>=0)and(RBP[y]<9.5)
  1804. then Write(PN[y],RBP[y]:0:0,' ');
  1805. if(RBP[y]>=9.5)and(RBP[y]<=99.5)
  1806. then Write(PN[y],RBP[y]:0:0)end;
  1807.  
  1808. if y=0then Write(' ');Write(' ');
  1809.  
  1810. for i:=1to 6do begin
  1811. if(e[i]>0)and(e[i]<0.95)then
  1812. Write('<',(e[i]*10):0:0,' ')else begin
  1813. if e[i]<0then begin
  1814. if e[i]<=-9.5then Write(e[i]:0:0);
  1815. if e[i]>-9.5then Write(e[i]:0:0,' ')end;
  1816. if e[i]>=0then begin if e[i]<9.5
  1817. then Write(' ',e[i]:0:0,' ');if e[i]>=9.5
  1818. then Write(' ',e[i]:0:0)end end end;
  1819.  
  1820. {6}Writeln;if oa=':'then Write(Ae)
  1821. else case(ET)of'E':Write(He);
  1822. 'T':Write(Te);'M':Write(Se)end;
  1823. r:=WgP*mr;if(r>0)and(r<0.95)then
  1824. Write('<',(r*10):0:0,' ')else begin
  1825. if r>=0then Write('_');if(r<9.5)and(r>=0)
  1826. then Write(r:0:0,' ');
  1827. if(r>9.5)and(r>=0)then Write(r:0:0);
  1828. if(r>-9.5)and(r<0)then Write(r:0:0,' ');
  1829. if(r<-9.5)then Write(r:0:0)end;
  1830. Write(' ');if oa=':'then
  1831. for i:=1to 5do eE[i]:=TsA[i]*mc else
  1832. case(ET)of
  1833. 'E':for i:=1to 5do eE[i]:=Es0[i]*mc;
  1834. 'T':for i:=1to 5do eE[i]:=Ts[i]*mc;
  1835. 'M':for i:=1to 5do eE[i]:=TsM[i]*mc end;
  1836. for i:=1to 5do begin
  1837. if(eE[i]>0)and(eE[i]<0.95)then
  1838. Write('<',(eE[i]*10):0:0,' ')else begin
  1839. if eE[i]>=0then Write(' ');
  1840. if(eE[i]<9.5)and(eE[i]>=0)
  1841. then Write(eE[i]:0:0,' ');
  1842. if(eE[i]>9.5)and(eE[i]>=0)
  1843. then Write(eE[i]:0:0);
  1844. if(eE[i]>-9.5)and(eE[i]<0)
  1845. then Write(eE[i]:0:0,' ');
  1846. if(eE[i]<-9.5)then
  1847. Write(eE[i]:0:0)end end;
  1848. if(eE[i]>9.5)or(eE[i]>-9.5)then
  1849. Write('__')else Write(' _');
  1850.  
  1851. for i:=1to 6do begin
  1852. if i=Mi then begin
  1853. if(e[7]>0)and(e[7]<0.95)then
  1854. Write('<',(e[7]*10):0:0,' ')else begin
  1855. if e[7]<0then begin
  1856. if e[7]<=-9.5then Write(e[7]:0:0);
  1857. if e[7]>-9.5then Write(e[7]:0:0,'_')end;
  1858. if e[7]>=0then begin if e[7]<9.5
  1859. then Write(' ',e[7]:0:0,'_');if e[7]>=9.5
  1860. then Write(' ',e[7]:0:0)end end end;
  1861. if (i>Mi)or(i<Mi)then Write('___')end;
  1862. Writeln('_') {Md<='S'}end;
  1863.  
  1864.  
  1865. {7}if Md<='M'then begin {M Mode}
  1866. Write(' ');
  1867. for i:=1to b do e[i]:=Bs[i]*100;
  1868. if b>=8then if e[8]<9.5 then
  1869. Write(e[8]:0:0,' ')else Write(e[8]:0:0);
  1870. if b<8then Write(' ');Write(' ');
  1871. if e[7]<9.5then Write(e[7]:0:0,' ')
  1872. else Write(e[7]:0:0);Write(' ');
  1873. if b=9then if e[9]<9.5then
  1874. Write(e[9]:0:0,' ')else Write(e[9]:0:0);
  1875. if b<9then Write(' ');Write(' ');
  1876. for i:=1to 6do if e[i]<9.5
  1877. then Write(e[i]:0:0,' ')
  1878. else Write(e[i]:0:0,' ');Writeln;
  1879.  
  1880. {8}Write(' ');
  1881. for i:=1to b do e[i]:=RBg[i]*100;
  1882. if b<8then Write(' ')else
  1883. if e[8]<9.5then Write(e[8]:0:0,' ')
  1884. else Write(e[8]:0:0);Write(' ');
  1885. if e[7]<9.5then Write(e[7]:0:0,' ')
  1886. else Write(e[7]:0:0);Write(' ');
  1887. if b<9then Write(' ')else
  1888. if e[9]<9.5then Write(e[9]:0:0,' ')
  1889. else Write(e[9]:0:0);Write(' ');
  1890. for i:=1to 6do
  1891. if e[i]<9.5then Write(e[i]:0:0,' ')
  1892. else Write(e[i]:0:0,' ');Writeln;
  1893.  
  1894. {9}Write(' ');
  1895. for i:=1to b do e[i]:=RBc[i]*100;
  1896. if b<8then Write(' ')else
  1897. if e[8]<9.5then Write(e[8]:0:0,' ')
  1898. else Write(e[8]:0:0);Write(' ');
  1899. if e[7]<9.5then Write(e[7]:0:0,' ')
  1900. else Write(e[7]:0:0);Write(' ');
  1901. if b<9then Write(' ')else
  1902. if e[9]<9.5then Write(e[9]:0:0,' ')
  1903. else Write(e[9]:0:0);Write(' ');
  1904. for i:=1to 6do
  1905. if e[i]<9.5then Write(e[i]:0:0,' ')
  1906. else Write(e[i]:0:0,' ');
  1907.  
  1908. {10}Writeln;Write('_____');
  1909. for i:=1to b do
  1910. if PN[i]=' 'then PN[i]:='_';
  1911. if b>=8then begin if RBP[8]<9.5
  1912. then Write(PN[8],RBP[8]:0:0,'_')
  1913. else Write(PN[8],RBP[8]:0:0)end;
  1914. if b<8then Write('___');Write('___');
  1915. if RBP[7]<9.5
  1916. then Write(PN[7],RBP[7]:0:0,'____')
  1917. else Write(PN[7],RBP[7]:0:0,'___');
  1918. if b=9then begin if RBP[9]<9.5
  1919. then Write(PN[9],RBP[9]:0:0,'_')
  1920. else Write(PN[9],RBP[9]:0:0)end;
  1921. if b<9then Write('___');Write('__');
  1922. for i:=1to 6do begin if RBP[i]<9.5
  1923. then Write(PN[i],RBP[i]:0:0,'_')
  1924. else Write(PN[i],RBP[i]:0:0)end;
  1925. Writeln('_') {M Mode} end; G3:
  1926.  
  1927. if(zP=1)and(Pi>2)then goto G5;
  1928.  
  1929. z0:=z0+1; G5: zP:=zP+1;
  1930. kP:=zP;while kP>=Pi do kP:=kP-Pi;
  1931.  
  1932. if kP>0then goto G4;
  1933.  
  1934.  
  1935. if(Rr='o')and(zr<7)and(Oo='o')then begin
  1936. if(Yy='_')then begin if Gn='r'then
  1937. Write(Re,'_ ')else Write(Re,' ');
  1938.  
  1939. for i:=1to 5do e[i]:=EcR[i]*mc;
  1940. Write(' ');for i:=1to 5do begin
  1941. if(e[i]>0)and(e[i]<0.95)then
  1942. Write('<',(e[i]*10):0:0,' ')else begin
  1943. if e[i]>=0then Write(' ');
  1944. if(e[i]<9.5)and(e[i]>=0)
  1945. then Write(e[i]:0:0,' ');
  1946. if(e[i]>9.5)and(e[i]>=0)
  1947. then Write(e[i]:0:0);
  1948. if(e[i]>-9.5)and(e[i]<0)
  1949. then Write(e[i]:0:0,' ');if(e[i]<-9.5)
  1950. then Write(e[i]:0:0)end end;
  1951.  
  1952. if(Zz='-')or(Zz='.')then begin
  1953.  
  1954. if Is='.'then begin Write(' ');
  1955. for i:=1to b do e[i]:=RBr[i]*mc;
  1956. for i:=1to 6do begin
  1957. if(e[i]>0)and(e[i]<0.95)then
  1958. Write('<',(e[i]*10):0:0,' ')else begin
  1959. if e[i]<0then begin
  1960. if e[i]<=-9.5then Write(e[i]:0:0);
  1961. if e[i]>-9.5then Write(e[i]:0:0,' ')end;
  1962. if e[i]>=0then begin if e[i]<9.5
  1963. then Write(' ',e[i]:0:0,' ');if e[i]>=9.5
  1964. then Write(' ',e[i]:0:0)end end end;
  1965. Writeln;Write(' ')end;case(Zz)of
  1966. '-':for i:=1to 5do e[i]:=Es0[i]*mc;
  1967. '.':for i:=1to 5do e[i]:=TmR[i]*mr end;
  1968. Write(' ');for i:=1to 5do begin
  1969. if(e[i]>0)and(e[i]<0.95)then
  1970. Write('<',(e[i]*10):0:0,' ')else begin
  1971. if e[i]>=0then Write(' ');
  1972. if(e[i]<9.5)and(e[i]>=0)
  1973. then Write(e[i]:0:0,' ');
  1974. if(e[i]>9.5)and(e[i]>=0)
  1975. then Write(e[i]:0:0);
  1976. if(e[i]>-9.5)and(e[i]<0)
  1977. then Write(e[i]:0:0,' ');
  1978. if(e[i]<-9.5)then
  1979. Write(e[i]:0:0)end end;
  1980. if(e[i]>9.5)or(e[i]>-9.5)then
  1981. Write(' ')else Write(' ')end;
  1982.  
  1983. if Is='.'then begin
  1984. for i:=1to 6do begin
  1985. if i=Mi then begin
  1986. if(e[7]>0)and(e[7]<0.95)then
  1987. Write('<',(e[7]*10):0:0)else begin
  1988. if e[7]<0then begin
  1989. if e[7]<=-9.5then Write(e[7]:0:0);
  1990. if e[7]>-9.5then Write(e[7]:0:0)end;
  1991. if e[7]>=0then begin if e[7]<9.5
  1992. then Write(' ',e[7]:0:0);if e[7]>=9.5
  1993. then Write(e[7]:0:0)end end end;
  1994. if (i>Mi)or(i<Mi)then Write(' ')end;
  1995. end;Writeln;
  1996.  
  1997. if ci='i'then begin
  1998. for i:=1to b do Mli[i]:=' ';
  1999. for i:=1to b do
  2000. if(Bei[i]='|')then Mli[Ep[i]]:='|';
  2001. for i:=1to b do if(i=Mi)or(i=7)then
  2002. Mli[Ep[i]]:='*';for i:=1to b do
  2003. if(Bei[i]='/')then Mli[Ep[i]]:='/';
  2004. Write(' ');for i:=1to 5do
  2005. Write(Mli[i],' ');Writeln end end end;
  2006.  
  2007.  
  2008. Ap[zr,kT]:=WgP;
  2009. Ap[0,kT]:=Ap[0,kT]+Ap[zr,kT];
  2010. Ar[zr,kT]:=Ap[0,kT];
  2011. {P-1}
  2012. if WgP>0then Rp[zr,kT]:=1;
  2013. if WgP=0then Rp[zr,kT]:=0;
  2014. if(WgP<0)and(WgP>-99)then Rp[zr,kT]:=-1;
  2015. Rp[0,kT]:=Rp[0,kT]+Rp[zr,kT];
  2016. if((WgP>0)and(aT[kT]='1'))
  2017. or((WgP<0)and(aT[kT]='2'))
  2018. then jW[zr]:=jW[zr]+1;
  2019. Wp[kT,zr]:=Wp[kT,zr]+jW[zr];
  2020. if(Rp[zr,kT]=0)then jU[zr]:=jU[zr]+1;
  2021. Up[kT,zr]:=Up[kT,zr]+jU[zr];
  2022. if((WgP>0)and(aT[kT]='2'))
  2023. or((WgP<0)and(aT[kT]='1'))
  2024. then Lp[zr]:=Lp[zr]+1;
  2025. {Output}if(Rr='R')or(Rr='r')then begin
  2026. if Rr='r'then begin
  2027. if zr>9then Write(zr)else Write(' ',zr);
  2028. Write(') ',Ih,Cl,Ie,' ');
  2029. if Pw='<'then Write(Pw)else Write(' ');
  2030. Write(T[kT]);
  2031. if Pw='>'then Write(Pw)else Write(' ');
  2032. Write(' ');Writeln(kT,'_',kT-Up[kT,zr],
  2033. '/',Wp[kT,zr],' ',
  2034. Wp[kT,zr]-((kT-Up[kT,zr])-Wp[kT,zr]),
  2035. ' ',Rp[0,kT]:0:0,' ',I5[zr],I6[zr]);
  2036. if zr=zu then Writeln end end;
  2037.  
  2038. until zr=zu;
  2039. z:=z+1;until (o=0)or(kT=Sk)or(z=Ct); G1:
  2040.  
  2041.  
  2042. {P-2}
  2043. if Ed=':'then for i:=1to Ct do begin
  2044. if Rp[0,i]<0 then Rp[0,i]:=-2;
  2045. if Rp[0,i]>0 then Rp[0,i]:=1 end;
  2046. if Ed='.'then for i:=1to Ct do begin
  2047. r:=1;if zu>9then r:=9/zu;
  2048. Rp[0,i]:=Rp[0,i]/(1/r) end;
  2049.  
  2050. j:=0;k:=0;for i:=1to Ct do begin
  2051. if Rp[0,i]=0then j:=j+1;F0[i]:=j;
  2052. if(Rp[0,i]>0)and(aT[i]='1')
  2053. then T[i]:='R';
  2054. if(Rp[0,i]>0)and(aT[i]='2')
  2055. then T[i]:='b';
  2056. if(Rp[0,i]<0)and(aT[i]='2')
  2057. then T[i]:='B';
  2058. if(Rp[0,i]<0)and(aT[i]='1')
  2059. then T[i]:='r';
  2060. if(Rp[0,i]=0)and(aT[i]='1')
  2061. then T[i]:='<';
  2062. if(Rp[0,i]=0)and(aT[i]='2')
  2063. then T[i]:='>';
  2064. if(Rp[0,i]=0)and(aT[i]='x')
  2065. then T[i]:='z'else
  2066. if aT[i]='x'then T[i]:='x';
  2067. if T[i]='z'then kz:=kz+1;Fz[i]:=kz;
  2068. if T[i]='x'then k:=k+1;Fx[i]:=k end;
  2069. F2:=0;j:=0;k:=0;for i:=1to Ct do begin
  2070. if F1[i]=0then F1[i]:=k;
  2071. if((Rp[0,i]>0)and((T[i]='R')or(T[i]='r'))
  2072. )or((Rp[0,i]<0)and((T[i]='B')or(T[i]='b')
  2073. ))then begin k:=k+1;F1[i]:=k;
  2074. if Rp[0,i]>0then F2:=F2+Rp[0,i];
  2075. if(Rp[0,i]<0)then F2:=F2-Rp[0,i]end;
  2076. if((Rp[0,i]>0)and((T[i]='B')or(T[i]='b'))
  2077. )or((Rp[0,i]<0)and((T[i]='R')or(T[i]='r')
  2078. ))or(T[i]='x')then begin
  2079. if Rp[0,i]>0 then F2:=F2-Rp[0,i];
  2080. if(Rp[0,i]<0)then F2:=F2+Rp[0,i]end;
  2081. F3L[i]:=F1[i]-((i-F0[i])-F1[i])end;
  2082.  
  2083.  
  2084. {RATINGS}if(Cs='r')and(Rr='o')and(zr=zu)
  2085. then begin Writeln;if St>0 then Read(St);
  2086. if St>0then begin Readln;i:=1;k:=1;k3:=1;
  2087. Readln(k2);while i>0 do begin Read(i);
  2088. if(i=0)or(i=99)then begin Read(a);
  2089. for k1:=1to 7do Read(DSt[k,k1]);
  2090. k:=k+1;k3:=k3+1;end;
  2091. if(k2=k3-1)or(i=0)then goto SLs;
  2092. while not EoLn do begin Read(j);
  2093. SL[i,j]:='-';if SLn[i,j]=0then
  2094. SLn[i,j]:=k3 else SLf[i,j]:=SLf[i,j]+1
  2095. end;Readln end;SLs:
  2096.  
  2097. Read(p);while p>0 do begin Readln(p)end;
  2098. Readln(p);if p=Cj then begin
  2099. for i:=1to Cj do for j:=1to Cj do
  2100. if SL[Mo[i],Mo[j]]='-'then begin
  2101. SL1[i]:=SL1[i]+1;SL2[j]:=SL2[j]+1 end;
  2102. for i:=1to Ct do Write(SL1[i],' ');
  2103. Writeln;for i:=1to Ct do
  2104. Write(SL2[i],' ');Writeln end;
  2105. for i:=1to p do Read(SL1[i]);
  2106. for i:=1to p do Read(SL2[i]);
  2107. if Cj=27then goto G2;
  2108.  
  2109. for i:=1to Ct do Woi[i]:='_';
  2110. for i:=1to Ct do for j:=1to Ct do
  2111. if(i>j)or(i<j)then begin case(i)of
  2112. 1:a:='l';4:a:='i';7:a:='f';10:a:='c';
  2113. 2:a:='k';5:a:='h';8:a:='e';11:a:='b';
  2114. 3:a:='j';6:a:='g';9:a:='d';12:a:='a'end;
  2115. if Wo[i]=Wo[j]then
  2116. begin Woi[i]:=a;Woi[j]:=a end end;
  2117. if St=6then begin
  2118. for i:=1to 41do Write('_');Writeln;
  2119. Write(' ');for i:=1to Ct do
  2120. if Rn[i]>9then Write(Rn[i],' ')else
  2121. Write(Rn[i],' ');Writeln;
  2122. for i:=1to Ct do for j:=1to Ct do begin
  2123. if j=1then begin Write(' ');
  2124. if Rn[i]>9then Write(Rn[i],' ')
  2125. else Write(Rn[i],' ')end;
  2126. k3:=SLf[Mo[i],Mo[j]];if k3=0then
  2127. Write(' ')else if k3>0then if k3>9
  2128. then Write(k3,' ')else Write(k3,' ');
  2129. if j=Ct then Writeln end;
  2130. for i:=1to 41do Write('_');Writeln;
  2131. Write(' ');for i:=1to Ct do
  2132. if Rn[i]>9then Write(Rn[i],' ')else
  2133. Write(Rn[i],' ');Writeln;
  2134. for i:=1to Ct do for j:=1to Ct do begin
  2135. if j=1then begin Write(' ');
  2136. if Rn[i]>9then Write(Rn[i],' ')
  2137. else Write(Rn[i],' ')end;
  2138. Write(SL[Mo[i],Mo[j]],' ');
  2139. if j=Ct then Writeln end{St=6}end;
  2140. if St=6then St:=9;
  2141.  
  2142. if(Cj<13)and(p>0)then begin
  2143. for i:=1to 41do Write('_');Writeln;
  2144. Write(' ');
  2145. for i:=1to Ct do if SL1[Mo[i]]>9then
  2146. Write(' ',SL1[Mo[i]])else
  2147. Write(' ',SL1[Mo[i]],' ');Writeln;
  2148. Write(' ');
  2149. for i:=1to Ct do if SL2[Mo[i]]>9then
  2150. Write(' ',SL2[Mo[i]])else
  2151. Write(' ',SL2[Mo[i]],' ');Writeln end;
  2152.  
  2153. Write('______');for i:=1to Ct do
  2154. if i<12then if Woi[i]='_'then
  2155. Write('___')else Write(Woi[i],'__');
  2156. if Ct=12then if Woi[i]='_'then
  2157. Write('__')else Write(Woi[i],'_');
  2158. if Ct<12then begin for i:=1to
  2159. 11-Ct do Write('___');Write('__')end;
  2160. Writeln;Write('______');for i:=1to Ct do
  2161. if i<12then if Xw[i]=0then Write('___')
  2162. else if Xw[i]>9then Write(Xw[i],'_')
  2163. else Write(Xw[i],'__');
  2164. if Ct=12then if Xw[i]=0then
  2165. Writeln('__')else if Xw[i]>9then
  2166. Writeln(Xw[i])else Writeln(Xw[i],'_');
  2167. if Ct<12then begin for i:=1to
  2168. 11-Ct do Write('___');Writeln('__')end;
  2169. Write(' ');for i:=1to Ct do
  2170. if Mo[i]>9then Write(Mo[i],' ')
  2171. else Write(Mo[i],' ');Writeln;
  2172. Write(' ');for i:=1to Ct do
  2173. if Rn[i]>9then Write(Rn[i],' ')else
  2174. Write(Rn[i],' ');Writeln;
  2175. for i:=1to Ct do for j:=1to Ct do begin
  2176. if j=1then begin
  2177. if Mo[i]>9then Write(Mo[i],' ')
  2178. else Write(Mo[i],' ');
  2179. if Rn[i]>9then Write(Rn[i],' ')
  2180. else Write(Rn[i],' ')end;
  2181. if St=7then Write(SL[Mo[i],Mo[j]],' ');
  2182. if St=8then k3:=SLf[Mo[i],Mo[j]];
  2183. if St=9then k3:=SLn[Mo[i],Mo[j]];
  2184. if(St=8)or(St=9)then if k3=0then
  2185. Write(' ')else if k3>0then if k3>9
  2186. then Write(k3,' ')else Write(k3,' ');
  2187. if j=Ct then Writeln end;
  2188. for i:=1to 41do Write('_');Writeln;
  2189. j:=0;for i:=1to k-1 do begin j:=j+1;
  2190. for k1:=1to 7do Write(DSt[i,k1]);
  2191. Write(i,' ');if(j=4)and(i<k-1)
  2192. then begin Writeln;j:=0 end end;Writeln;
  2193. for i:=1to 41do Write('_');Writeln;
  2194. Write('99 ',Yr-2020,Db[3]);
  2195. if Mt>9then Write(Mt)else Write('0',Mt);
  2196. if Dy>9then Write(Dy)else Write('0',Dy);
  2197. Write(Db[4],' (',An,')');
  2198. if Cj<0then Write(Cj);
  2199. Writeln;Writeln;{St>0}end;
  2200. if St=0then begin Writeln;for i:=1to
  2201. Ct do if Xw[i]=0then Write('__ ')
  2202. else if Xw[i]>9then Write(Xw[i],' ')
  2203. else Write(Xw[i],' ');Writeln{St=0}end;
  2204. Write(' ');for i:=1to Ct do
  2205. if Wo[i]>9then Write(Wo[i],' ')
  2206. else Write(Wo[i],' ');Writeln;
  2207.  
  2208. Sj:=0;for i:=1to 19do Write('_');
  2209. Writeln(I8[zr]);Write(oEo,Xx,oa,' ');
  2210. if Wn[1]=0then Write('?');for i:=1
  2211. to Cw-1 do Write(Wn[i],' ');Writeln;
  2212. Writeln('__________________',oE,
  2213. '____________________');
  2214. k:=0;for i:=1 to Ct do begin k:=k+1;
  2215. if Rn[i]>9then Write(' ',Rn[i],' ')else
  2216. Write(' ',Rn[i],' ');if(k=10)and(i<Ct)
  2217. then begin Writeln;k:=0 end end;Writeln;
  2218. for i:=1to 41do Write('_');Writeln;k1:=1;
  2219. k:=0;if Ip='_'then rL:=zu else rL:=0;
  2220. for i:=1to Ct do Ap[0,i]:=Ap[0,i]/zu;
  2221. for i:=0to rL do for j:=1to Ct do begin
  2222. if(i=1)and(j=1)then begin
  2223. Write('_');for k2:=1to Ct do begin
  2224. if Woi[k2]='_'then Write('____')else
  2225. Write(Woi[k2],'___');if(k2=10)and(Ct>10)
  2226. then begin Writeln;Write('_')end end;
  2227. Writeln;if zu=1then goto Sk1 end;
  2228. Ap[i,j]:=Ap[i,j]*mr;k:=k+1;
  2229. if(Ap[i,j]>=0)and(Ap[i,j]<9.5)then
  2230. Write(' ',Ap[i,j]:0:0,' ');
  2231. if Ap[i,j]>=9.5then
  2232. Write(' ',Ap[i,j]:0:0,' ');
  2233. if(Ap[i,j]<0)and(Ap[i,j]>-9.5)
  2234. then Write(Ap[i,j]:0:0,' ');
  2235. if(Ap[i,j]<0)and(Ap[i,j]<=-9.5)
  2236. then Write(Ap[i,j]:0:0,' ');
  2237. if(j=Ct)or((k=10)and(j<Ct-1))then
  2238. begin if j=Ct then Writeln(I5[i])
  2239. else Writeln;k1:=k1+1;k:=0 end;
  2240.  
  2241. if(i=4)and(j=Ct)and(i<zu)then begin
  2242. k1:=k1+2;for k2:=1to Ct do begin
  2243. Ar[i,k2]:=(Ar[i,k2]/i)*mr;
  2244. if(Ar[i,k2]>=0)and(Ar[i,k2]<9.5)then
  2245. Write(' ',Ar[i,k2]:0:0,' ');
  2246. if Ar[i,k2]>=9.5then
  2247. Write(' ',Ar[i,k2]:0:0,' ');
  2248. if(Ar[i,k2]<0)and(Ar[i,k2]>-9.5)
  2249. then Write(Ar[i,k2]:0:0,' ');
  2250. if(Ar[i,k2]<0)and(Ar[i,k2]<=-9.5)
  2251. then Write(Ar[i,k2]:0:0,' ')end;
  2252. Writeln(I7[i]);Writeln end end;Sj:=Sj-k1;
  2253. Writeln('__________________',oE,
  2254. '____________________');
  2255. k1:=1;k:=0;for i:=1to Ct do begin k:=k+1;
  2256. if Rp[0,i]=0then Write(' - ')else if
  2257. Rp[0,i]<0then Write(Rp[0,i]:0:0,' ')
  2258. else Write(' ',Rp[0,i]:0:0,' ');
  2259. if((k=10)and(i<Ct-1))then begin
  2260. Writeln;k1:=k1+1;k:=0 end end;Writeln;
  2261. for i:=1to 41do Write('_');Writeln;
  2262. if Yy='_'then Sj:=Sj-1;
  2263. for i:=1to Ct do begin Write(Lo[i],' ');
  2264. if i=10then Writeln end;Writeln;
  2265. for i:=1to Ct do begin if Mo[i]>9then
  2266. Write(Mo[i],' ')else Write(Mo[i],' ');
  2267. if i=10then Writeln end;Writeln end; Sk1:
  2268.  
  2269. G2: if Ct=27then begin
  2270. for i:=1to 41do Write('_');Writeln;
  2271. Writeln(' 1234567890 1234567890 ',
  2272. '1234567');
  2273. for i:=1to Ct do for j:=1to Ct do begin
  2274. if j=1then if i>9then Write(i,' ')
  2275. else Write(' ',i,' ');
  2276. if(j=11)or(j=21)then Write(' ');
  2277. Write(SL[Mo[i],Mo[j]]);if j=Ct then begin
  2278. if i>9then Write(' ',i)else
  2279. Write(' ',i,' ');Writeln end;if(j=Ct)
  2280. and((i=11)or(i=21))then Writeln(' ',
  2281. '1234567890 1234567890 1234567')end;
  2282. Writeln(' 1234567890 1234567890 ',
  2283. '1234567');
  2284. for i:=1to 41do Write('_');Writeln end;
  2285.  
  2286. for i:=1to 18+Sj do Writeln End.
Success #stdin #stdout 2.22s 12936KB
stdin
p________________________________________
^ _________________________________ i 27
666 661 662 676 671 672 686 681 682
766 761 762 776 771 772 786 781 782
866 861 862 876 871 872 886 881 882 0
_________________________________________
. _________________________________ i 12
8	6	6	6	7	8	7	7	7	6	6	8
7	6	6	7	8	6	6	8	6	7	7	7
8	6	6	7	6	6	7	6	7	6	6	6
5 _______________________________________ 
_   - 07  _____________n___o_____r______e
D  _Hour  Dy  Mt  Year T_z . : _ S * 6
   04 07  10  11  2024 s-n o 7  -9
01 _____  0 - 0   99   _ . - .  00  00  0 
  T-0000                     .  --- --- .
_1___2___3___4___5___6___7___8___9___0__n
 .   .   .   .   .   .   .   .   .   .  
1 2 3 4 5 6 7 8 9 10 11 12
0 0 9 Newcastle_4     o / o
_________________________________________
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
3 14 10 1 17 9 19 15 11 21 12 8 20
0 6 _____________________________________
999
3  13 17 15 5  24
14  19 24 23 9
99 4c1121c
10  8  4  11 16 21
1  25 17 5 17 14 13 23
99 4c1121b
17  9  10 23
99 4c1110c
9  1  14 27 23 1  25
99 4c1029c
17  26 5  13
99 4c1029b
19  15 26 5  7
99 4b1028c
10  25 2  25 5  11
99 4j1024d
15  17 20 14 20 20
99 4l1014c
11  2  5  20
11  15 2  7  12 25
21  7  10 18
12  19 8  25 10
8   6  26 5  6
20  21 10 8  8  17
20  3  21 5  6
1   18 2  10 11
0 4d1006d
0
27
10 0 5 0 0 0 0 3 0 8 7 4 0 4 3 0 3 0 4 7 3 0 0 0 0 0 0 
0 3 1 1 8 2 3 3 1 4 2 1 3 2 3 1 4 2 2 2 2 0 2 2 4 3 0
_________________________________________
stdout
_________________________________________
  __*(s)   67-(0407)   (10)   11   2024
 (120)c   0749(0300)  7(10)   11   2024
      W                 Ec    Wl    We

o    (6)   

10 0 5 0 0 0 0 3 5 8 7 4 0 4 3 0 6 0 4 7 3 0 0 0 0 0 0 
1 3 1 1 8 2 3 3 2 5 2 1 3 3 3 1 4 2 2 2 2 0 4 2 5 3 1 
_________________________________________
      1234567890 1234567890 1234567
 1     -  -    - - --  --     - -      1 
 2                                     2 
 3        -        - - -       -       3 
 4                                     4 
 5                                     5 
 6                                     6 
 7                                     7 
 8        --                     -     8 
 9    -             -         - - -    9 
10     - --  -   -    -     -   -      10
11     -  - -     -  -    -     -      11
      1234567890 1234567890 1234567
12           - -         -      -      12
13                                     13
14            -          -    --       14
15                  -  -  -            15
16                                     16
17        -   --   -          -  -     17
18                                     18
19        - -        -           -     19
20      - -- - -       -    -          20
21          -  -        -              21
      1234567890 1234567890 1234567
22                                     22
23                                     23
24                                     24
25                                     25
26                                     26
27                                     27
      1234567890 1234567890 1234567
_________________________________________