This code is time limit exceeded.. help me out

#include
using namespace std;

int main()
{
// your code goes here
int t;
cin>>t;
while(t–)
{
int n,k,i;
cin>>n>>k;
if(n<k)
{
cout<<n<<endl;
}
else if(n==k)
{
cout<<0<<endl;
}
else if(n>k)
{
for(i=0;n>=0n=n-k)
{
i=n;
}
cout<<i<<endl;
}

}
return 0;

}

You should paste the link of the problem and your submission when asking for help. I have no idea which problem is this.