Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function f(start, current : integer) : integer;
- begin
- if current = start then
- result := 1
- else if current < start then
- result := 0
- else
- begin
- var count_ways := f(start, current-1);
- count_ways += f(start, current-2);
- if current mod 2 = 0 then
- count_ways += f(start, current div 2);
- result := count_ways;
- end;
- end;
- begin
- print(f(3,10)*f(10,12));
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement