#include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
#define PI (acos(-1.0))
int main()
{
int t;
double a, b;
scanf("%d", &t);
while (t--)
{
scanf("%lf%lf", &a, &b);
double sum = a * PI + 2 * b;
long long ans = sum * 1000000;
sum = (double)(ans) / 1000000;//截断
printf("%.6lf\n", sum);
}
}