Number of cups(N):
Number of balls(M):