def No_of_Triangle(N,K):
    if N < K:
        return 0
    if K == 1:
        # Count all upward and downward pointing triangles of all sizes
        # For an equilateral triangle of side N:
        # Upward pointing triangles of size k: (N-k+1)*(N-k+2)/2
        # Downward pointing triangles of size k: exist when N >= 2k, count = (N-2k+1)*(N-2k+2)/2... 
        # Actually the formula for total triangles in equilateral triangle of side N:
        # Total = N*(N+2)*(2N+1)/8 if N even, (N*(N+2)*(2N+1)-1)/8... 
        # Let me use the known formula
        # Number of upward triangles of size k: (N-k+1)(N-k+2)/2
        # Number of downward triangles of size k: (N-2k+1)(N-2k+2)/2 for N >= 2k
        total = 0
        for k in range(1, N+1):
            # upward
            total += (N-k+1)*(N-k+2)//2
            # downward
            if N >= 2*k:
                total += (N-2*k+1)*(N-2*k+2)//2
        return total
    else:
        # Count triangles of size K within triangle of size N
        # Upward pointing of size K: (N-K+1)*(N-K+2)/2
        # Downward pointing of size K: (N-2K+1)*(N-2K+2)/2 if N >= 2K
        upward = (N-K+1)*(N-K+2)//2
        downward = 0
        if N >= 2*K:
            downward = (N-2*K+1)*(N-2*K+2)//2
        return upward + downward