{{{ #!cplusplus //732185 2008-07-31 12:03:42 Accepted 1248 0MS 12K 556 B G++ whiteTiger #include int dp[10001]; int min(int a, int b, int c){ if(a > b) a = b; if(a > c) a = c; return a; } void init(){ int i, p1, p2, p3; int p[3] = {150, 200, 350}; for(i = 0; i < 150; i++) dp[i] = i; for(i=150; i< 10001; i++){ p1 = p2 = p3 = 9999; p1 = dp[i-p[0]]; if(i >= 200) p2 = dp[i-p[1]]; if(i >= 350) p3 = dp[i-p[2]]; dp[i] = min(p1, p2, p3); } } int main(){ init(); int N, m; scanf("%d", &N); while(N--){ scanf("%d", &m); printf("%d\n", dp[m]); } return 0; } } /*written by zl 876149 2008-11-05 15:59:37 Accepted 1248 0MS 0K 453 B C++ passing */ #include using namespace std; int main() { int casenum; cin>>casenum; for(int i=0;i