{ Name: OANA-LIA BALAN School Name: "Dr. I. Mesota" National College; Romania School Code: 7156 Contest: #1 Division: Senior 3 } program acsl_post; uses crt; var f:text; ok:boolean; c,p,z,l,h,t,ss:real;sz,fz,s:string[6]; test,er:integer; function zone(s:string):integer; begin val(s,ss,er); if (ss>=1)and(ss<=6999) then zone:=1 else if (ss>=7000)and(ss<=19999) then zone:=2 else if (ss>=20000)and(ss<=35999) then zone:=3 else if (ss>=36000)and(ss<=62999) then zone:=4 else if (ss>=63000)and(ss<=84999) then zone:=5 else if (ss>=85000)and(ss<=99999) then zone:=6; end; function regular:boolean; begin ok:=false; if (l>=3.5)and(l<=4.25)and(h>=3.5)and(h<=6)and(t>=0.007)and(t<=0.016) then ok:=true; regular:=ok; end; function largep:boolean; begin ok:=false; if (l>=4.25)and(l<=6)and(h>=6)and(h<=11.5)and(t>=0.007)and(t<=0.016) then ok:=true; largep:=ok; end; function envelope:boolean; begin ok:=false; if (l>=3.5)and(l<=6.125)and(h>=5)and(h<=11.5)and(t>=0.016)and(t<=0.25) then ok:=true; envelope:=ok; end; function largee:boolean; begin ok:=false; if (l>=6.125)and(l<=24)and(h>=11)and(h<=18)and(t>=0.25)and(t<=0.5) then ok:=true; largee:=ok; end; function package:boolean; begin ok:=false; if (c<=84)and(frac(t)=0) then ok:=true; package:=ok; end; function lpackage:boolean; begin ok:=false; if (c>84)and(c<=130) then ok:=true; lpackage:=ok; end; begin clrscr; assign(f,'input.txt');reset(f); For test:=1 to 5 do begin write(test,'. '); read(f,l,h,t);readln(f,sz,fz); z:=abs(zone(sz)-zone(fz)); p:=0;c:=l+2*(h+t); if regular then p:=0.20+0.03*z else if largep then p:=0.37+0.03*z else if envelope then p:=0.37+0.04*z else if largee then p:=0.60+0.05*z else if package then p:=2.95+0.25*z else if lpackage then p:=3.95+0.35*z; if p=0 then writeln('UNMAILABLE') else if (p<1)and(p>0)then writeln('.',p*100:2:0) else writeln(p:2:2); End; readln; close(f); end