a=int(input("Enter the 1st num of A.P:"))
n=int(input("Enter the total  num of A.P:"))
d=int(input("Enter the common differece:"))
total=(n*(2*a+(n-1)*d))/2
tn=a+(n-1)*d
print("The sum of A,P=",total)
print("The tn term of A,P=",tn)
