Help me in solving CHFINVNT problem

My issue

could you please help me why it is showing tle which part of it is responsible for tle

My code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
	// your code goes here]
	ll t;
	cin>>t;
	while(t--){
	ll n,p,k;
	cin>>n>>p>>k;
	ll days=0;
  map<ll, ll>mp;
  for(ll i=0;i<n;i++){
    mp[i]=i%k;
  }

 
  for(ll i=0;i<n;i++){
    if(mp[i]<mp[p]) days++;
    else if(mp[i]==mp[p] && i<=p) days++;
    
    
    
  }
  cout<<days<<endl;
    
  
	 
	  
	}

    


}

Learning course: 1600 to 1800 difficulty problems
Problem Link: Chef and Bulb Invention Practice Problem in 1600 to 1800 difficulty problems - CodeChef

@nagaraju153
bro u can’t loop till N cozz of high value of N which is uptill 10^9.
thus looping part will give u tle.
hint :- think of some mathematical approach.