ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

I got WA,anyone help me!!!---URAL 1120
Posted by + Calculous + 18 Aug 2003 14:00
I tested my program with some datas made by me, all are correct.
but I got WA when I submited my program.

who can give me some test data or tell me why I got WA?

specially thanks!

here are my code:

{$N+}
Const
  zero=1e-8;
Var
  n,t,k:longint;
  p:extended;

Procedure print;
var t:longint;
begin
  t:=trunc(p-k div 2);
  if not odd(k) then inc(t);
  writeln(t,' ',k);
  halt;
end;

Begin
  readln(n);
  if n=1 then
    begin
      writeln('1 1'); halt;
    end;
  t:=trunc(sqrt(2)*sqrt(n));
  for k:=t downto 1 do
    begin
      p:=n/k;
      if p-k/2-0.5<=zero then  continue;
      if (odd(k)) and (frac(p)<=zero) then print;
      if (not odd(k)) and (abs(frac(p)-0.5)<=zero)then print;
    end;
End.