#5256

BÀI TẬP :   89

  1. def GiaiThua(n):
  2.     kq=1
  3.     for i in range(1,n+1):
  4.         kq*=i
  5.     return kq
  6. def C(n,k):
  7.     return GiaiThua(n)/(GiaiThua(k)*GiaiThua(n-k))
  8. m=int(input())
  9. s=0
  10. for i in range(0,m):
  11.     n,k=map(int,input().split())
  12.     s+=C(n,k)
  13. print(“%0.0f”%s)