BETA
School Problem's Submission isn't counted in score!

Total Submissions: 2820 Accuracy:

12.55%

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 Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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