Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {R+,S+,Q+,I+,O-}
- {$R-,S-,Q-,I-,O+}
- var
- u,q,n,d,i,j: longint;
- s: array [0..300010] of char;
- begin
- // assign(input,'in'); reset(input);
- // assign(output,'out'); rewrite(output);
- read(n);
- if n mod 2 <> 0 then q:=2 else
- if n mod 3 <> 0 then q:=3 else
- if n mod 5 <> 0 then q:=5 else
- if n mod 7 <> 0 then q:=7 else
- if n mod 11 <> 0 then q:=11 else
- if n mod 13 <> 0 then q:=13 else
- begin
- q:=0;
- for i:=1 to n do s[i]:=Chr(Ord('a')+(i-1) mod 17);
- if n mod 8 = 0 then u:=9
- else u:=8;
- for i:=n div 2 to n do s[i]:=Chr(Ord('r')+(i-1) mod u);
- end;
- if q > 0 then
- begin
- for i:=1 to n div 2 do s[i]:=Chr(Ord('a')+(i-1) mod q);
- for i:=n div 2+1 to n do s[i]:=Chr(Ord('n')+(i-1) mod q);
- end;
- { for d:=1 to n-1 do
- if n mod d = 0 then
- begin
- j:=d+1;
- for i:=1 to n do
- begin
- if s[i] = s[j] then
- begin
- writeln('collision found for d = ',d);
- while true do;
- break;
- end;
- inc(j);
- if j > n then j:=1;
- end;
- end; }
- for i:=1 to n do write(s[i]);
- writeln;
- close(input);
- close(output);
- end.
Add Comment
Please, Sign In to add comment