Codeforces Educational Codeforces Round 91 (Rated for Div. 2) 1380C. Create The Teams Solution
Problem Link : https://codeforces.com/contest/1380/problem/C
- /// Author : AH_Tonmoy
- #include <bits/stdc++.h>
- using namespace std;
- int32_t main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- int t;
- cin >> t;
- while (t--) {
- int n , x ;
- cin >> n >> x ;
- std::vector<int>a(n);
- for ( int i = 0 ; i < n ; i++){
- cin >> a[i] ;
- }
- sort(a.rbegin(),a.rend()) ;
- int ans = 0 , index_cnt = 0;
- for ( int i = 0 ; i < n ; i++){
- index_cnt++ ;
- if ( index_cnt * a[i] >= x){
- ans++ ;
- index_cnt = 0 ;
- }
- }
- cout << ans <<'\n';
- }
- return 0 ;
- }
No comments