long fi(int n) { if (n < 0){ return -1; } if (n == 0){ return 1; } else { long r = 1; for (long i = 1; i <= n; i++){ r = r * i; } return r; } }