#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
	freopen ( "Knownothing.in", "r", stdin );
freopen ( "Knownothing.out", "w", stdout );
	int count;
	double t1, t2, s1, s2, s, tall;
	cin >> count;
	for (int i=0;i<count;i++)
	{
		cin >> t1 >> t2 >> s1 >> s2 >> s;
		tall=0;
		if(s2>=s1 && s1<s)
		{
			cout << "NO\n";
			continue;
		}
		while(s1<s)
		{
			s-=s1;
			s+=s2;
			tall+=(t1+t2);
		}
		tall+=(s*t1/s1);
		printf("%.2f\n",tall);
	}
}
