input: Write a function to compute the value of ncr%p.
  assert ncr_modp(10,2,13)==6
  assert ncr_modp(15,12,43)==25
  assert ncr_modp(17,9,18)==10
  
output: def ncr_modp(n, r, p):
      if r > n:
          return 0
      if r == 0 or r == n:
          return 1
      num = 1
      denom = 1
      for i in range(r):
          num = (num * (n - i)) % p
          denom = (denom * (i + 1)) % p
      return (num * pow(denom, p - 2, p)) % p