Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

template <typename Arg1>
void pn(Arg1&& arg1)
{ cout<<arg1<<"\n";}
template <typename Arg1, typename... Args>
void pn(Arg1&& arg1, Args&&... args)
{ cout<<arg1<<"\n"; pn(args...); }

template <typename Arg1>
void ps(Arg1&& arg1)
{ cout<<arg1<<" ";}
template <typename Arg1, typename... Args>
void ps(Arg1&& arg1, Args&&... args)
{ cout<<arg1<<" "; ps(args...); }

template <typename Arg1>
void pvs(Arg1&& arg1, ll n)
{ for(ll i=0;i<n;i++)ps(arg1[i]); }
template <typename Arg1>
void pvn(Arg1&& arg1, ll n)
{ for(ll i=0;i<n;i++)pn(arg1[i]); }

ll lcm(ll a,ll b) 
{ return (a*b)/__gcd(a,b); }

ll mulmod(ll a,ll b,ll mod) 
{ ll res=0; a=a%mod; 
    while(b>0)
    { if(b%2==1) res=(res+a)%mod; 
      a=(a*2)%mod; b/=2; }
    return res % mod; } 

ll mulpow(ll x,ll y,ll p) 
{ ll res=1; x=x%p;
    while(y>0) 
    { if (y&1) res=(res*x)%p; 
      y=y>>1; x=(x*x)%p; } 
    return res; } 

ll modInverse(ll n, ll p) 
{ return mulpow(n, p-2, p); } 

ll log(ll n, ll b)
{ ll c=0;
	while(n>(b-1))
	{ c++; n/=b; } return c; }

ll fib(ll n) 
{ double phi=(1+sqrt(5))/2; 
  return round(pow(phi,n)/sqrt(5)); } 

vector<bool> prime;
void sieve(int n)
{ prime.resize(n,true);
	for(int p=2;p*p<=n;p++)
		if(prime[p])
			for(int i=p*p;i<=n;i+=p)
				prime[i]=false; }

#define MOD 1000000007 //10^9+7
#define pi 3.14159265358979323846
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<=n;i++)
#define fd(i,n) for(i=n-1;i>=0;i--)
#define fn(i,s,d) for(i=s;i<d;i++)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) a.size()
#define vl vector<ll>
#define vb vector<bool>
#define vd vector<double>
#define vvl vector<vl>
#define vs vector<string>
#define vvs vector<vs>
#define pl pair<ll,ll>
#define pd pair<double,double>
#define vpl vector<pl>
#define vpd vector<pd>
#define vvpl vector<vpl>
#define ff first
#define ss second
#define um unordered_map
#define dsort(v) sort(v); reverse(v);


void solve()
{
	ll i,j;
	ll n,m,k;
	cin>>n>>m>>k;
	ll nn= n /k;
	ll mm=m/k;
	ll ans=mm-nn;
	if(n%k==0)
		ans++;
	pn(ans);
	return;
}

int main()
{
	#ifdef Deeksha
		freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    #endif
	std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	solve();/* 
	ll t;
	cin>>t;
	for(ll tt=1;tt<=t;tt++)
	{
		//cout<<"Case #"<<tt<<": ";
		solve();
	}
	//*/
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

template <typename Arg1>
void pn(Arg1&& arg1)
{ cout<<arg1<<"\n";}
template <typename Arg1, typename... Args>
void pn(Arg1&& arg1, Args&&... args)
{ cout<<arg1<<"\n"; pn(args...); }

template <typename Arg1>
void ps(Arg1&& arg1)
{ cout<<arg1<<" ";}
template <typename Arg1, typename... Args>
void ps(Arg1&& arg1, Args&&... args)
{ cout<<arg1<<" "; ps(args...); }

template <typename Arg1>
void pvs(Arg1&& arg1, ll n)
{ for(ll i=0;i<n;i++)ps(arg1[i]); }
template <typename Arg1>
void pvn(Arg1&& arg1, ll n)
{ for(ll i=0;i<n;i++)pn(arg1[i]); }

ll lcm(ll a,ll b) 
{ return (a*b)/__gcd(a,b); }

ll mulmod(ll a,ll b,ll mod) 
{ ll res=0; a=a%mod; 
    while(b>0)
    { if(b%2==1) res=(res+a)%mod; 
      a=(a*2)%mod; b/=2; }
    return res % mod; } 

ll mulpow(ll x,ll y,ll p) 
{ ll res=1; x=x%p;
    while(y>0) 
    { if (y&1) res=(res*x)%p; 
      y=y>>1; x=(x*x)%p; } 
    return res; } 

ll modInverse(ll n, ll p) 
{ return mulpow(n, p-2, p); } 

ll log(ll n, ll b)
{ ll c=0;
	while(n>(b-1))
	{ c++; n/=b; } return c; }

ll fib(ll n) 
{ double phi=(1+sqrt(5))/2; 
  return round(pow(phi,n)/sqrt(5)); } 

vector<bool> prime;
void sieve(int n)
{ prime.resize(n,true);
	for(int p=2;p*p<=n;p++)
		if(prime[p])
			for(int i=p*p;i<=n;i+=p)
				prime[i]=false; }

#define MOD 1000000007 //10^9+7
#define pi 3.14159265358979323846
#define f0(i,n) for(i=0;i<n;i++)
#define f1(i,n) for(i=1;i<=n;i++)
#define fd(i,n) for(i=n-1;i>=0;i--)
#define fn(i,s,d) for(i=s;i<d;i++)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) a.size()
#define vl vector<ll>
#define vb vector<bool>
#define vd vector<double>
#define vvl vector<vl>
#define vs vector<string>
#define vvs vector<vs>
#define pl pair<ll,ll>
#define pd pair<double,double>
#define vpl vector<pl>
#define vpd vector<pd>
#define vvpl vector<vpl>
#define ff first
#define ss second
#define um unordered_map
#define dsort(v) sort(v); reverse(v);


void solve()
{
	ll i,j;
	ll n,m,k;
	cin>>n>>m>>k;
	ll nn= n /k;
	ll mm=m/k;
	ll ans=mm-nn;
	if(n%k==0)
		ans++;
	pn(ans);
	return;
}

int main()
{
	#ifdef Deeksha
		freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    #endif
	std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	solve();/* 
	ll t;
	cin>>t;
	for(ll tt=1;tt<=t;tt++)
	{
		//cout<<"Case #"<<tt<<": ";
		solve();
	}
	//*/
}



Compiler output:
a.cc:127:6: error: redefinition of 'template<class Arg1> void pn(Arg1&&)'
  127 | void pn(Arg1&& arg1)
      |      ^~
a.cc:6:6: note: 'template<class Arg1> void pn(Arg1&&)' previously declared here
    6 | void pn(Arg1&& arg1)
      |      ^~
a.cc:130:6: error: redefinition of 'template<class Arg1, class ... Args> void pn(Arg1&&, Args&& ...)'
  130 | void pn(Arg1&& arg1, Args&&... args)
      |      ^~
a.cc:9:6: note: 'template<class Arg1, class ... Args> void pn(Arg1&&, Args&& ...)' previously declared here
    9 | void pn(Arg1&& arg1, Args&&... args)
      |      ^~
a.cc:134:6: error: redefinition of 'template<class Arg1> void ps(Arg1&&)'
  134 | void ps(Arg1&& arg1)
      |      ^~
a.cc:13:6: note: 'template<class Arg1> void ps(Arg1&&)' previously declared here
   13 | void ps(Arg1&& arg1)
      |      ^~
a.cc:137:6: error: redefinition of 'template<class Arg1, class ... Args> void ps(Arg1&&, Args&& ...)'
  137 | void ps(Arg1&& arg1, Args&&... args)
      |      ^~
a.cc:16:6: note: 'template<class Arg1, class ... Args> void ps(Arg1&&, Args&& ...)' previously declared here
   16 | void ps(Arg1&& arg1, Args&&... args)
      |      ^~
a.cc:141:6: error: redefinition of 'template<class Arg1> void pvs(Arg1&&, ll)'
  141 | void pvs(Arg1&& arg1, ll n)
      |      ^~~
a.cc:20:6: note: 'template<class Arg1> void pvs(Arg1&&, ll)' previously declared here
   20 | void pvs(Arg1&& arg1, ll n)
      |      ^~~
a.cc:144:6: error: redefinition of 'template<class Arg1> void pvn(Arg1&&, ll)'
  144 | void pvn(Arg1&& arg1, ll n)
      |      ^~~
a.cc:23:6: note: 'template<class Arg1> void pvn(Arg1&&, ll)' previously declared here
   23 | void pvn(Arg1&& arg1, ll n)
      |      ^~~
a.cc:147:4: error: redefinition of 'll lcm(ll, ll)'
  147 | ll lcm(ll a,ll b)
      |    ^~~
a.cc:26:4: note: 'll lcm(ll, ll)' previously defined here
   26 | ll lcm(ll a,ll b)
      |    ^~~
a.cc:150:4: error: redefinition of 'll mulmod(ll, ll, ll)'
  150 | ll mulmod(ll a,ll b,ll mod)
      |    ^~~~~~
a.cc:29:4: note: 'll mulmod(ll, ll, ll)' previously defined here
   29 | ll mulmod(ll a,ll b,ll mod)
      |    ^~~~~~
a.cc:157:4: error: redefinition of 'll mulpow(ll, ll, ll)'
  157 | ll mulpow(ll x,ll y,ll p)
      |    ^~~~~~
a.cc:36:4: note: 'll mulpow(ll, ll, ll)' previously defined here
   36 | ll mulpow(ll x,ll y,ll p)
      |    ^~~~~~
a.cc:164:4: error: redefinition of 'll modInverse(ll, ll)'
  164 | ll modInverse(ll n, ll p)
      |    ^~~~~~~~~~
a.cc:43:4: note: 'll modInverse(ll, ll)' previously defined here
   43 | ll modInverse(ll n, ll p)
      |    ^~~~~~~~~~
a.cc:167:4: error: redefinition of 'll log(ll, ll)'
  167 | ll log(ll n, ll b)
      |    ^~~
a.cc:46:4: note: 'll log(ll, ll)' previously defined here
   46 | ll log(ll n, ll b)
      |    ^~~
a.cc:172:4: error: redefinition of 'll fib(ll)'
  172 | ll fib(ll n)
      |    ^~~
a.cc:51:4: note: 'll fib(ll)' previously defined here
   51 | ll fib(ll n)
      |    ^~~
a.cc:176:14: error: redefinition of 'std::vector<bool> prime'
  176 | vector<bool> prime;
      |              ^~~~~
a.cc:55:14: note: 'std::vector<bool> prime' previously declared here
   55 | vector<bool> prime;
      |              ^~~~~
a.cc:177:6: error: redefinition of 'void sieve(int)'
  177 | void sieve(int n)
      |      ^~~~~
a.cc:56:6: note: 'void sieve(int)' previously defined here
   56 | void sieve(int n)
      |      ^~~~~
a.cc:211:6: error: redefinition of 'void solve()'
  211 | void solve()
      |      ^~~~~
a.cc:90:6: note: 'void solve()' previously defined here
   90 | void solve()
      |      ^~~~~
a.cc:225:5: error: redefinition of 'int main()'
  225 | int main()
      |     ^~~~
a.cc:104:5: note: 'int main()' previously defined here
  104 | int main()
      |     ^~~~