Write a Program to calculate the sum of n terms of a Geometric Progression when first term a and common ratio r is given.
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.
For each test case the output will be the sum of n terms of GP.
1 <= T<= 100
1 <= N <= 100
1 <= a,r <= 100