#include using namespace std; template void read(T &t) { t=0; char ch=getchar(); int f=1; while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); } do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f; } int T,n,dp[410]; int a[110]; int main() { //freopen("1.txt","r",stdin); a[60]=a[61]=10; a[62]=a[63]=a[64]=17; a[65]=a[66]=20; a[67]=a[68]=a[69]=23; a[70]=a[71]=a[72]=a[73]=a[74]=27; for (int i=75;i<=79;i++) a[i]=30; for (int i=80;i<=84;i++) a[i]=33; for (int i=85;i<=89;i++) a[i]=37; for (int i=90;i<=94;i++) a[i]=40; for (int i=95;i<=100;i++) a[i]=43; for (int i=1;i<=400;i++) for (int j=0;j<=100&&j<=i;j++) dp[i]=max(dp[i],dp[i-j]+a[j]); read(T); while (T--) { read(n); printf("%.1lf\n",dp[n]*1.0/10); } return 0; } /* 0. Enough array size? Enough array size? Enough array size? Interger overflow? 1. Think TWICE, Code ONCE! Are there any counterexamples to your algo? 2. Be careful about the BOUNDARIES! N=1? P=1? Something about 0? 3. Do not make STUPID MISTAKES! Time complexity? Memory usage? Precision error? */