{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1} {$MINSTACKSIZE $00004000} {$MAXSTACKSIZE $00100000} {$IMAGEBASE $00400000} {$APPTYPE GUI} {$WARN SYMBOL_DEPRECATED ON} {$WARN SYMBOL_LIBRARY ON} {$WARN SYMBOL_PLATFORM ON} {$WARN UNIT_LIBRARY ON} {$WARN UNIT_PLATFORM ON} {$WARN UNIT_DEPRECATED ON} {$WARN HRESULT_COMPAT ON} {$WARN HIDING_MEMBER ON} {$WARN HIDDEN_VIRTUAL ON} {$WARN GARBAGE ON} {$WARN BOUNDS_ERROR ON} {$WARN ZERO_NIL_COMPAT ON} {$WARN STRING_CONST_TRUNCED ON} {$WARN FOR_LOOP_VAR_VARPAR ON} {$WARN TYPED_CONST_VARPAR ON} {$WARN ASG_TO_TYPED_CONST ON} {$WARN CASE_LABEL_RANGE ON} {$WARN FOR_VARIABLE ON} {$WARN CONSTRUCTING_ABSTRACT ON} {$WARN COMPARISON_FALSE ON} {$WARN COMPARISON_TRUE ON} {$WARN COMPARING_SIGNED_UNSIGNED ON} {$WARN COMBINING_SIGNED_UNSIGNED ON} {$WARN UNSUPPORTED_CONSTRUCT ON} {$WARN FILE_OPEN ON} {$WARN FILE_OPEN_UNITSRC ON} {$WARN BAD_GLOBAL_SYMBOL ON} {$WARN DUPLICATE_CTOR_DTOR ON} {$WARN INVALID_DIRECTIVE ON} {$WARN PACKAGE_NO_LINK ON} {$WARN PACKAGED_THREADVAR ON} {$WARN IMPLICIT_IMPORT ON} {$WARN HPPEMIT_IGNORED ON} {$WARN NO_RETVAL ON} {$WARN USE_BEFORE_DEF ON} {$WARN FOR_LOOP_VAR_UNDEF ON} {$WARN UNIT_NAME_MISMATCH ON} {$WARN NO_CFG_FILE_FOUND ON} {$WARN MESSAGE_DIRECTIVE ON} {$WARN IMPLICIT_VARIANTS ON} {$WARN UNICODE_TO_LOCALE ON} {$WARN LOCALE_TO_UNICODE ON} {$WARN IMAGEBASE_MULTIPLE ON} {$WARN SUSPICIOUS_TYPECAST ON} {$WARN PRIVATE_PROPACCESSOR ON} {$WARN UNSAFE_TYPE OFF} {$WARN UNSAFE_CODE OFF} {$WARN UNSAFE_CAST OFF} program Project1; {$APPTYPE CONSOLE} const inp='Input.txt'; outp='Output.txt'; maxn=50; type Vertex=record x:Integer; y:Integer; end; var n,Count:byte; a,b:array [1..maxn+1] of Vertex; T:array [1..maxn] of Boolean; f:Text; p,s:Real; procedure readdata; var i:byte; begin assign (f,inp); reset (f); readln (f,n); for i:=1 to n do begin readln (f,a[i].x,a[i].y); t[i]:=False; end; close (f); end; procedure calc; var i,j,min,z:Byte; x1,y1,x2,y2,temp:Real; q1,q2,poisk:Boolean; begin min:=1; for i:=2 to n do if a[i].x0 for j:=1 to n do if (not q1) or (not q2) then begin temp:=(x2-x1)*(a[j].y-y1)-(y2-y1)*(a[j].x-x1); if temp<0 then q1:=True else if temp>0 then q2:=True else if (j<>i) and (j<>z) then begin q1:=True; q2:=True; end; end else break; if (not q1) or (not q2) then begin z:=i; inc (Count); x1:=x2; y1:=y2; T[i]:=True; b[Count]:=a[i]; poisk:=True; end; end; end; p:=0; s:=0; b[Count+1]:=b[1]; for i:=1 to Count do begin s:=s+(b[i].x+b[i+1].x)*(b[i].y-b[i+1].y); p:=p+sqrt(sqr(b[i].x-b[i+1].x)+sqr(b[i].y-b[i+1].y)); end; s:=0.5*abs(s); end; procedure writedata; begin Assign (f,outp); rewrite (f); writeln (f,p:0:2); writeln (f,s:0:2); close (f); end; begin readdata; calc; writedata; end.