1
2
3
4
int weight(int i) {
  if (i<=1) return 1;
  return i*weight(i-1);
}