标签:rac nbsp contest jsb strong pre wan this action
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4950
5 3 2 2 0 0 0 0
Case #1: NO
、
#include<cstdio>
typedef __int64 LL;
int main()
{
LL h,a,b,k;
LL cas = 0;
while(~scanf("%I64d%I64d%I64d%I64d",&h,&a,&b,&k))
{
if(h==0 && a==0 && b==0 && k==0)
break;
printf("Case #%I64d: ",++cas);
if(h <= a)//第一回合怪兽就死亡
{
printf("YES\n");
continue;
}
if((k-1)*(-a+b)-a+h <= 0)//前K回合怪兽死亡
{
printf("YES\n");
continue;
}
if(k*(-a+b)+b < 0)//每K回合后怪兽的血量在降低
{
printf("YES\n");
continue;
}
printf("NO\n");
}
return 0;
}
标签:rac nbsp contest jsb strong pre wan this action
原文地址:http://www.cnblogs.com/brucemengbm/p/7191985.html