Time limit exceeded

https://www.codechef.com/LRNDSA01/problems/MULTHREE

#include
using namespace std;

int main() {
int t;
cin>>t;
for(int j=0;j<t;j++)
{
long long int k,d0,d1,sum,ans;
cin>>k>>d0>>d1;
sum=0;
ans=0;
for(int i=0;i<k;i++)
{
ans=(ans+d0+d1)%10;
sum=sum+ans;
}
if(sum%3==0)
{
cout<<“YES”<<"\n";
}
else
{
cout<<“NO”<<"\n";
}

}
// your code goes here
return 0;

}
i tried to debug but receiving time limit exceeded