i;main(long n){for(gets(&n);i=~scanf("%ld",&n);printf("%f\n",n>13?n+1.66:n<7?6:n*n/9.-n*1.4+14.36));}