Language: C++

/** templates starts here **/
#define ll long long int
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define pb push_back
#define stll stack<ll>
#define qll queue<ll>
#define pqll priority_queue<ll>
#define mpii map<int,int>
#define mpll map<ll,ll>
#define mpss map<string,string>
#define mpsi map<string,int>
#define mpis map<int,string>
#define mpsll map<string,ll>
#define mplls map<ll,string>
#define sit set<int>::iterator
#define slit set<ll>::iterator
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define asrt(a) sort(a, a+n)
#define grtasrt(a) sort(a, a+n,greater<int>())
#define FOR(i,j,k) for(int i=j;i<k;i++)
#define REV(i,j,k) for(int i=j;i>k;i--)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define mem(a,x) memset(a,x,sizeof(a))
#define inf 0x3f3f3f3f
#define mx 1000005
const int mod=1e9+7;
const int N = (int) 1e5 + 5;
/** templates ends here **/


int main ()
{

    fast;
    ll n, K;
    cin>>n>>K;
    ll a[n];
    FOR(i, 0, n)cin>>a[i];
    asrt(a);
    ll mn = a[0];
    vi v;
    ll cnt = 0;
    if(n == K){
            cout<<"1"<<endl;
            return 0;
    }
    FOR(i, 0, n)
    {
        if(a[i] == mn && mn!=a[n-1])
        {
            cnt++;
            ll ff = K-1;
            a[i+ff] = mn;
            //for(ll bb = 0; bb<K; bb++)
            //{
                //v.pb(mn);
           // }
        }
    }
   // FOR(i, 0, v.size())cout<<v[i]<<endl;
    cout<<cnt<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: 'ios_base' has not been declared
   29 | #define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
      |              ^~~~~~~~
a.cc:41:5: note: in expansion of macro 'fast'
   41 |     fast;
      |     ^~~~
a.cc:29:47: error: 'cin' was not declared in this scope
   29 | #define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
      |                                               ^~~
a.cc:41:5: note: in expansion of macro 'fast'
   41 |     fast;
      |     ^~~~
a.cc:29:55: error: 'NULL' was not declared in this scope
   29 | #define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
      |                                                       ^~~~
a.cc:41:5: note: in expansion of macro 'fast'
   41 |     fast;
      |     ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | /** templates starts here **/
a.cc:25:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 | #define asrt(a) sort(a, a+n)
      |                 ^~~~
a.cc:46:5: note: in expansion of macro 'asrt'
   46 |     asrt(a);
      |     ^~~~
a.cc:5:12: error: 'vector' was not declared in this scope
    5 | #define vi vector<int>
      |            ^~~~~~
a.cc:48:5: note: in expansion of macro 'vi'
   48 |     vi v;
      |     ^~
a.cc:5:19: error: expected primary-expression before 'int'
    5 | #define vi vector<int>
      |                   ^~~
a.cc:48:5: note: in expansion of macro 'vi'
   48 |     vi v;
      |     ^~
a.cc:51:13: error: 'cout' was not declared in this scope
   51 |             cout<<"1"<<endl;
      |             ^~~~
a.cc:51:24: error: 'endl' was not declared in this scope
   51 |             cout<<"1"<<endl;
      |                        ^~~~
a.cc:68:5: error: 'cout' was not declared in this scope
   68 |     cout<<cnt<<endl;
      |     ^~~~
a.cc:68:16: error: 'endl' was not declared in this scope
   68 |     cout<<cnt<<endl;
      |                ^~~~