In [9]:
def sumup(m,n,k):
    total = 0
    
    if m >= n:
        temp = m
        m = n
        n = temp
    
    total = m
    while m < n:
        m = m + k
        total = total + m
    return total

m = int(input('please enter the forst integer,end with a tab: '))
n = int(input('please enter the second integer,end with a tab: '))
k = int(input('please enter the third integer,end with a tab: '))
print(sumup(m,n,k))


please enter the forst integer,end with a tab: 2
please enter the second integer,end with a tab: 10
please enter the third integer,end with a tab: 1
54