|
|
вернуться в форумWA 18 var b,a,i,c,n,d,an,k,x:integer; // many variables from other programms... dev:boolean; s:string; begin read(k,n); dev:=true; b:=1001; //didn't no about abs if n<0 then x:=-1; if n>0 then x:=1; for i:=1 to k do begin read(a); if (0<a*x) and (a*x<n*x) and dev then begin s:=('Impossible'); dev:=false end; // can't reach the end if abs(a)<b then b:=abs(a); //nearest obsacle to start point end; if dev then // output begin if n>0 then writeln(n,' ',n+b*2); if n<0 then writeln(abs(n)+2*b,' ',abs(n)); end else writeln(s); end. **********Can't understand what's wrong************ Re: WA 18 input : 15 23 252 33 215 789 1000 123 -125 29 -45 -450 121 -555 -72 120 123 output : 23 113 |
|
|