summaryrefslogtreecommitdiff
path: root/progs/a439.py
blob: 2ed5b6262abcd00ee5c9dd414ad3b5a78126c778 (plain)
1
2
3
4
5
6
def count_Squares(m,n):
    if(n < m):
        temp = m
        m = n
        n = temp
    return ((m * (m + 1) * (2 * m + 1) / 6 + (n - m) * m * (m + 1) / 2))