Find Your Solution Here

Codeforces

codeforces solution 432A – Choosing Teams

Problem link—432A – Choosing Teams
/*

Harun-or-Rashid

CSEDU-23rd Batch

*/

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,k,i,cnt=0;
    scanf("%d%d",&n,&k);
    int a[n];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++){
        if(5-a[i]>=k){
            cnt++;
        }
    }
    printf("%d\n",cnt/3);
    return 0;
}

Leave a Reply