Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i := 2 to n do
- begin
- a[i] := a[i - 1] * 5;
- for j := i div 5 to i - 1 do
- begin
- if (a[j] * 2 > a[i - 1]) and (a[j] * 2 < a[i]) then
- a[i] := a[j] * 2;
- if (a[j] * 3 > a[i - 1]) and (a[j] * 3 < a[i]) then
- a[i] := a[j] * 3;
- if (a[j] * 5 > a[i - 1]) and (a[j] * 5 < a[i]) then
- a[i] := a[j] * 5;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement