#include #include #include #include using namespace std; const int S[] = {95, 90, 85, 80, 75, 70, 67, 65, 62, 60, 0}; const double V[] = {4.3, 4.0, 3.7, 3.3, 3.0, 2.7, 2.3, 2.0, 1.7, 1.0, 0.0}; double gpa(int v) { for (int i = 0; i < 11; i++) if (v >= S[i]) return V[i]; return 0; } void work() { int k; double ans = -1.0; cin >> k; for (int a = 0; a <= 100 && a + a + a + a <= k; a++) for (int b = a; b <= 100 && a + b + b + b <= k; b++) for (int c = b; c <= 100 && a + b + c + c <= k; c++) { int d = k - a - b - c; if (c <= d) { ans = max(ans, gpa(a) + gpa(b) + gpa(c) + gpa(d)); } } cout << fixed << setprecision(1) << ans << endl; } int main() { ios::sync_with_stdio(false); int T; cin >> T; while (T--) work(); return 0; }