Question: 
Write a python function to count the number of squares in a rectangle.


Model's Code:
def count_Squares(length, width):
    total_squares = 0
    for i in range(1, min(length, width) + 1):
        total_squares += (length - i + 1) * (width - i + 1)
    return total_squares



Sample Correct Code:
def count_Squares(m,n): 
    if (n < m): 
        temp = m 
        m = n 
        n = temp 
    return n * (n + 1) * (3 * m - n + 1) // 6


Asserts:
assert count_Squares(4,3) == 20
assert count_Squares(1,2) == 2
assert count_Squares(2,2) == 5


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 347 of 974: 251/347 (72.3342939481268%): success