http://acm.hdu.edu.cn/showproblem.php?pid=1248

我乱搞的,标准做法01背包

View Code
#include <stdio.h>
int test(int n)
{
    if(n<150)return n;
    if(n>200&&n<300)return n-200;
    return n%50;
}
int main()
{
    int t,n;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        printf("%d\n",test(n));
    }
    return 0;
}