rt
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
double t, m, a, b, c;
int main(){
cin >> t >> m;
while(t--){
cin >> a >> b >> c;
if(b * b - 4 * a * c < 0){
cout << "NO\n";
continue;
}
else{
double maxn = max((-b - sqrt(b * b - 4 * a * c)) / 2 / a, (-b + sqrt(b * b - 4 * a * c)) / 2 / a);
cout << maxn << '\n';
}
}
return 0;
}