不知道对不对
#include <stdio.h>
#include <math.h>
double solution(int n, double x) {
return sqrt(n + (n == 1?x:solution(n-1,x)));
}
int main(int argc, char *argv[])
{
int c;
int n;
double x;
scanf("%d", &c);
while(c--) {
scanf("%d %lf", &n,&x);
printf("%.3lf\n", solution(n,x));
}
return 0;
}