A series with same common difference is known as arithmetic series. The first term of series is 'a' and common difference is d. The series looks like a, a + d, a + 2d, a + 3d, . . . Find the sum of series.
Input : a = 1 d = 2 n = 4 Output : 16 1 + 3 + 5 + 7 = 16 Input : a = 2.5 d = 1.5 n = 20 Output : 335
The first line consists of an integer T i.e number of test cases. The first line and only line of each test case consists of three values a,d,n.
Print the sum of the series. With two decimal places.
1 <= T <= 100
1 <= a,d,n <= 104
1 2 4
2.5 1.5 20
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.