Hi everyone.

I am always getting WA in this problem. Every time.

I have implemented all hints posted there (like removing space in the end of output) and so on, but WA continues.

**Please**, can someone share with me some test cases, probably specific and unusual -

*I cannot find any mistake in my code...*
Btw,

Code: Select all

```
program Project1;
{$APPTYPE CONSOLE}
var
s,t: string;
i,j,k,ci: integer;
soc: set of char;
procedure doyourtime;
var
fl: boolean;
begin
fl := false;
if length(s) >= 8 then
begin
for i:=1 to length(s) - 8 + 1 do
begin
if fl then
write (s[i])
else
if s[i]<>'0' then
begin
fl := true;
write (s[i])
end;
end;
if fl then write (' ');
write ('kuti ');
delete (s,1,length(s)-8+1);
while s[1] = '0' do
begin
delete (s,1,1);
if length(s)=0 then break
end;
end;
fl := false;
if length(s) >= 6 then
begin
for i:=1 to length(s) - 6 + 1 do
begin
if fl then
write (s[i])
else
if s[i]<>'0' then
begin
fl := true;
write (s[i])
end;
end;
if fl then write (' ');
write ('lakh ');
delete (s,1,length(s)-6+1);
while s[1] = '0' do
begin
delete (s,1,1);
if length(s)=0 then break
end;
end;
fl := false;
if length(s) >= 4 then
begin
for i:=1 to length(s) - 4 + 1 do
begin
if fl then
write (s[i])
else
if s[i]<>'0' then
begin
fl := true;
write (s[i])
end;
end;
if fl then write (' ');
write ('hajar ');
delete (s,1,length(s)-4+1);
while s[1] = '0' do
begin
delete (s,1,1);
if length(s)=0 then break
end;
end;
fl := false;
if length(s) >= 3 then
begin
for i:=1 to length(s) - 3 + 1 do
begin
if fl then
write (s[i])
else
if s[i]<>'0' then
begin
fl := true;
write (s[i])
end;
end;
if fl then write (' ');
write ('shata ');
delete (s,1,length(s)-3+1);
while s[1] = '0' do
begin
delete (s,1,1);
if length(s)>0 then break
end;
end;
end;
begin
soc := ['0'..'9'];
ci := 0;
while not eof do
begin
ci := ci + 1;
readln (s);
while not (s[length(s)] in soc) do
delete (s,length(s),1);
write (ci:4,'. ');
while s[1] = '0' do
begin
delete (s,1,1);
if length(s)=0 then break
end;
if length(s)=0 then
begin
writeln (0);
continue
end;
t := s;
if length(s)>=10 then
begin
t := s;
delete (t,1,length(t)-9);
delete (s,length(s)-8,9);
s := s + '00';
doyourtime;
end;
s := t;
doyourtime;
if length(s) > 0 then
write (s);
writeln
end;
end.
```