/*** C ***/
#include <stdio.h>

int a[100];

void foo(int x, int y, int z)
{
  int w;

  if (z > y) {
    printf("*");
  }
  else {
    for (w = a[z-1]+1; w <= x; w++) {
       a[z] = w;
       foo(x, y, z+1);
    }
  }
}

int main(void)
{
  a[0] = 0;
  foo(300, 50, 1);
}



{*** Pascal ***}
var a:array[0..99] of integer;

procedure foo(x,y,z:integer);
var w:integer;
begin
  if z > y then
    write('*')
  else begin
    for w:=a[z-1]+1 to x do begin
       a[z]:=w;
       foo(x, y, z+1);
    end;
  end;
end;

begin
  a[0]:=0;
  foo(300,50,1);
end.
