公平分禮物

 avatar
user_3763047219
c_cpp
2 years ago
397 B
3
Indexable
Never
int main(){
	int N, K;
	int gift[106], c[100] = { 0 };
	scanf("%d %d", &N, &K);
	for (int i = 0; i < N;  i++) {
		scanf("%d", &gift[i]);
	}
	for (int i = 0; i < N; i++) {
		int x = 0;
		x = gift[i];
		c[x] = c[x] + 1;
	}
	int numb_of_gift = 0;
	for (int i = 0; i < 100; i++) {
		if (c[i] != 0) {
			numb_of_gift = numb_of_gift + c[i] / K;
		}
	}
	printf("%d", numb_of_gift);
}