Language: C++

#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:22:1: error: extended character   is not valid in an identifier
   22 |     int i=0,j,Lm;
      | ^
a.cc:22:1: error: extended character   is not valid in an identifier
a.cc:22:1: error: extended character   is not valid in an identifier
a.cc:23:1: error: extended character   is not valid in an identifier
   23 |     while(no>0 && i<n)
      | ^
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 |     {
      | ^
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 |        Lm=a[i]+k;
      | ^
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: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: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 |        for(j=i+1;j<i+c,j<n;j++)
      | ^
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 |          if(a[j]>Lm)
      | ^
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: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 |            break;
      | ^
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: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 |        i=j;
      | ^
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 |        no--;
      | ^
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 |     }
      | ^
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 |     if(no>0 && i>n)
      | ^
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 |       return true;
      | ^
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: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 |     if(no<=0 && i<n)
      | ^
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:39:2: error: extended character   is not valid in an identifier
   39 | {  std::ios::sync_with_stdio(false);
      |  ^
a.cc:40:1: error: extended character   is not valid in an identifier
   40 |    cin.tie(0);
      | ^
a.cc:40:1: error: extended character   is not valid in an identifier
a.cc:41:1: error: extended character   is not valid in an identifier
   41 |    cout.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 |    int lo,hg,mid,i,ans;
      | ^
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 |    cin>>n>>c>>k;
      | ^
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 |    a.rs(n);
      | ^
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 |    loop(i,0,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 |     cin>>a[i];
      | ^
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:46:1: error: extended character   is not valid in an identifier
a.cc:48:1: error: extended character   is not valid in an identifier
   48 |    lo=1;
      | ^
a.cc:48:1: error: extended character   is not valid in an identifier
a.cc:49:1: error: extended character   is not valid in an identifier
   49 |    hg=n;
      | ^
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 |    while(lo<hg)
      | ^
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 |    {
      | ^
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 |        mid=(lo+hg)/2;
      | ^
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
a.cc:52:1: error: extended character   is not valid in an identifier
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 |        if(can(mid))
      | ^
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 |        { ans=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 |           hg=mid-1;
      | ^
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: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 |        }
      | ^
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 |        else
      | ^
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