BETA
This is a school problem. Successful submissions of this are not counted in user ratings.

Submissions : 2648 Accuracy :

11.97

Sum of GP
     

Write a Program to calculate the sum of n terms of a Geometric Progression when first term a and common ratio r is given.

Input: 
The first line of the input contains T denoting the number of testcases. The first line of the test case will be the number of terms of GP and second line its first term and common ratio.

Output: 
For each test case the output will be the sum of n terms of GP.

Constraints:

1 <= T<= 100
1 <= N <= 100
1 <= a,r <= 100

Example:

Input:

1
3
3 2

Output:

21.000000

**For More Examples Use Expected Output**


Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.