|
|
back to boardWhy I have WA. plz help me Posted by Denol 30 Nov 2007 14:12 var a,b:extended; x,y,k:longint; a1,b2,max:extended; begin readln(a,b); readln(k); for x:=1 to k do begin y:=k-x; if (y*a)+(x*b)-sqr(y)-sqr(x)>max then begin max:=(y*a)+(x*b)-sqr(y)-sqr(x); a1:=y; b2:=x; end; end; writeln(max:0:2); writeln(a1:0:0,' ',b2:0:0); readln end. Re: Why I have WA. plz help me Posted by Sean38 2 Dec 2007 06:11 (x+y) can be smaller than K... |
|
|