#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
using namespace std;
const int MaxN = 1e5;
long long n, c, k;
long long num[MaxN + 5];
long long tot, cot, ans;
int main()
{
scanf("%I64d%I64d%I64d", &n, &c, &k);
for(int i = 1; i <= n; i++)scanf("%I64d", &num[i]);
sort(num + 1, num + n + 1);
ans = num[1] + k;
tot = 1;
cot = 1;
for(int i = 2; i <= n; i++)
{
if(num[i] <= ans && tot < c){tot++;continue;}
else
{
tot = 0;
cot++;
ans = num[i] + k;
}
}
printf("%I64d\n", cot);
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:13:37: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
scanf("%I64d%I64d%I64d", &n, &c, &k);
^
./Main.cpp:13:37: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘long long int*’ [-Wformat=]
./Main.cpp:13:37: warning: format ‘%d’ expects argument of type ‘int*’, but argument 4 has type ‘long long int*’ [-Wformat=]
./Main.cpp:14:51: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
for(int i = 1; i <= n; i++)scanf("%I64d", &num[i]);
^
./Main.cpp:29:23: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
printf("%I64d\n", cot);
^
./Main.cpp:13:38: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_resu...