#include<iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	while (n) {
		double h;
		int	w;
		cin >> h >> w;
		int temp = w;
		double sum = 0;
		while (temp) {
			if (temp == w) {
				sum += h;
			}
			else {
				h /= 2.0;
				sum += 2 * h;
			}
			temp--;
		}
		printf("%.2f\n", sum);
		n--;
	}
}