#include <cstdio>
#include <iostream>
using namespace std;
double f(int x) {
double y;
if (x >= 0 && x < 2) {
y = -x + 2.5;
} else if (x >= 2 && x < 4) {
y = 2 - 1.5 * (x - 3) * (x - 3);
} else if (x >= 4 && x < 6) {
y = x / 2.0 - 1.5;
}
return y;
}
int main() {
int m, x;
cin >> m;
while (m--) {
cin >> x;
printf("y=%.1f\n", f(x));
}
return 0;
}

京公网安备 11010502036488号