Spoj Problem solution for Dota Heros(DOTAA)

DOTAA

#include<iostream>
using namespace std;
int main()
{
int t,n,m,d,h;
scanf("%d",&t);

while(t--)
{
int count=0;
scanf("%d %d %d",&n,&m,&d);
while(n--)
{
scanf("%d",&h);
if(h>d)
{
while(h>0)
{
    h=h-d;
    count++;
   
}
count--;
}
}
if(count<m)
printf("NO\n");
else
printf("YES\n");
}
return(0);
}

No comments:

Post a Comment