Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var a:array [1..500] of byte; i,j,n,k,l:integer;
- begin
- readln(n,k);
- j:=n;i:=0;
- while j<>1 do begin
- if l=k then
- if a[i]=0 then begin a[k]:=1; l:=0;j:=j-1;end
- else if a[i]=0 then inc(l);inc(i);end;
- for i:=1 to n do if a[i]=0 then writeln(i);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement