<reponame>MjCode01/DS-Algo-Point
t1 = 2
t2 = 5
n = 5
print(t1+((n-1)*(t2-t1)))

"""
sample input 
Let the first term be 2 and second term be 5. Also let the value of n be 5
The programs calculates the nth term by using formula of ap i.e. a+ (n-1)d
Output is 14.
Time Complexity is O(1) and space complexity is O(1)
"""
