Language: C++

/code
#include<bits/stdc++.h>
#include<sstream>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define loop(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revloop(i,a,b) for(i=(int)a;i>=(int)b;i--)
#define stloop(it,v) for(it=v.begin();it!=v.end();++it)
#define ii pair<int,int>
#define MP make_pair
#define pb push_back
#define ll long long int
#define PI acos(-1.0)
#define f first
#define se second
#define rs resize
int n,k,c;
vector<int> a;
bool can(int no)
{
    int i=0,j,Lm;
    while(no>0 && i<n)
    {
       Lm=a[i]+k;
       for(j=i+1;j<i+c,j<n;j++)
         if(a[j]>Lm)
           break;
       i=j;
       no--;
    }
    if(no>0 && i>n)
      return true;
     if(no<=0 && i<n)
       return false;
     return true;
}
int main()
{  std::ios::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
   int lo,hg,mid,i,ans;
   cin>>n>>c>>k;
   a.rs(n);
   loop(i,0,n)
    cin>>a[i];
   sort(all(a));
   lo=1;
   hg=n;
   while(lo<hg)
   {
       mid=(lo+hg)/2;
       if(can(mid))
       { ans=mid;
          hg=mid-1;
       }
       else
         lo=mid+1;
   }
   cout<<ans;
  return 0;
}

Compiler output:
a.cc:23:1: error: extended character   is not valid in an identifier
   23 |     int i=0,j,Lm;
      | ^
a.cc:23:1: error: extended character   is not valid in an identifier
a.cc:23:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
   24 |     while(no>0 && i<n)
      | ^
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:24:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
   25 |     {
      | ^
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:25:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
   26 |        Lm=a[i]+k;
      | ^
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:26:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
   27 |        for(j=i+1;j<i+c,j<n;j++)
      | ^
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:27:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
   28 |          if(a[j]>Lm)
      | ^
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:28:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
   29 |            break;
      | ^
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:29:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
   30 |        i=j;
      | ^
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:30:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
   31 |        no--;
      | ^
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:31:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
   32 |     }
      | ^
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:32:1: error: extended character   is not valid in an identifier
a.cc:33:1: error: extended character   is not valid in an identifier
   33 |     if(no>0 && i>n)
      | ^
a.cc:33:1: error: extended character   is not valid in an identifier
a.cc:33:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
   34 |       return true;
      | ^
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:34:1: error: extended character   is not valid in an identifier
a.cc:35:1: error: extended character   is not valid in an identifier
   35 |      if(no<=0 && i<n)
      | ^
a.cc:35:1: error: extended character   is not valid in an identifier
a.cc:35:1: error: extended character   is not valid in an identifier
a.cc:40:2: error: extended character   is not valid in an identifier
   40 | {  std::ios::sync_with_stdio(false);
      |  ^
a.cc:41:1: error: extended character   is not valid in an identifier
   41 |    cin.tie(0);
      | ^
a.cc:41:1: error: extended character   is not valid in an identifier
a.cc:42:1: error: extended character   is not valid in an identifier
   42 |    cout.tie(0);
      | ^
a.cc:42:1: error: extended character   is not valid in an identifier
a.cc:43:1: error: extended character   is not valid in an identifier
   43 |    int lo,hg,mid,i,ans;
      | ^
a.cc:43:1: error: extended character   is not valid in an identifier
a.cc:44:1: error: extended character   is not valid in an identifier
   44 |    cin>>n>>c>>k;
      | ^
a.cc:44:1: error: extended character   is not valid in an identifier
a.cc:45:1: error: extended character   is not valid in an identifier
   45 |    a.rs(n);
      | ^
a.cc:45:1: error: extended character   is not valid in an identifier
a.cc:46:1: error: extended character   is not valid in an identifier
   46 |    loop(i,0,n)
      | ^
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:47:1: error: extended character   is not valid in an identifier
   47 |     cin>>a[i];
      | ^
a.cc:47:1: error: extended character   is not valid in an identifier
a.cc:47:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
   49 |    lo=1;
      | ^
a.cc:49:1: error: extended character   is not valid in an identifier
a.cc:50:1: error: extended character   is not valid in an identifier
   50 |    hg=n;
      | ^
a.cc:50:1: error: extended character   is not valid in an identifier
a.cc:51:1: error: extended character   is not valid in an identifier
   51 |    while(lo<hg)
      | ^
a.cc:51:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
   52 |    {
      | ^
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
   53 |        mid=(lo+hg)/2;
      | ^
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:53:1: error: extended character   is not valid in an identifier
a.cc:54:1: error: extended character   is not valid in an identifier
   54 |        if(can(mid))
      | ^
a.cc:54:1: error: extended character   is not valid in an identifier
a.cc:54:1: error: extended character   is not valid in an identifier
a.cc:54:1: error: extended character   is not valid in an identifier
a.cc:54:1: error: extended character   is not valid in an identifier
a.cc:54:1: error: extended character   is not valid in an identifier
a.cc:55:1: error: extended character   is not valid in an identifier
   55 |        { ans=mid;
      | ^
a.cc:55:1: error: extended character   is not valid in an identifier
a.cc:55:1: error: extended character   is not valid in an identifier
a.cc:55:1: error: extended character   is not valid in an identifier
a.cc:55:1: error: extended character   is not valid in an identifier
a.cc:55:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
   56 |           hg=mid-1;
      | ^
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:56:1: error: extended character   is not valid in an identifier
a.cc:57:1: error: extended character   is not valid in an identifier
   57 |        }
      | ^
a.cc:57:1: error: extended character   is not valid in an identifier
a.cc:57:1: error: extended character   is not valid in an identifier
a.cc:57:1: error: extended character   is not valid in an identifier
a.cc:57:1: error: extended character   is not valid in an identifier
a.cc:57:1: error: extended character   is not valid in an identifier
a.cc:58:1: error: extended character   is not valid in an identifier
   58 |        else
      | ^
a.cc:58:1: error: extended character   is not valid in an identifier
a.cc:58:1: error: extended character   is not valid in an identifier
a.cc:58:1: error: extended character   is not valid in an identifier
a.cc:58:1: error: extended character   is not valid in an identifier
a.cc:58:1: error: extended character   is not valid in an identifier
a.cc:59:1: error: extended character   is not valid in an identifier
   59