ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2057B - Gorilla and the Exam
Language: c++23 

Code 1:
#include <bits/stdc++.h>
using namespace std;

int main(){
    int t,n,k;
    long long a;
    vector<long long> nums;
    cin>>t;
    while(t--){
        cin>>n>>k;
        nums.resize(n);
        map<long long,int> mp;
        set<pair<int,long long>> st;
        for(int i=0;i<n;i++){
            cin>>nums[i];
            mp[nums[i]]++;
        }
        for(auto it : mp){
            st.insert({it.second,it.first});
        }
        
        
        while(k){
            auto it=*st.begin();
            if(k<it.first)  break;
            st.erase(st.begin());
            
            k-=it.first;
            
        }
        int size=st.size();
        cout<<max(1,size)<<endl;
    }
    return 0;
}

Code 2:
#include <bits/stdc++.h>
using namespace std;

int main(){
    int t,n,k,a;
    vector<int> nums;
    cin>>t;
    while(t--){
        cin>>n>>k;
        nums.resize(n);
        map<long long,int> mp;
        set<pair<int,long long>> st;
        for(int i=0;i<n;i++){
            cin>>nums[i];
            mp[nums[i]]++;
        }
        for(auto it : mp){
            st.insert({it.second,it.first});
        }
        
        
        while(k){
            auto it=*st.begin();
            st.erase(st.begin());
            if(k<it.first)  break;
            k-=it.first;
            
        }
        int size=st.size();
        cout<<max(1,size)<<endl;
    }
    return 0;
}

Answer: 1
Problem: 2057B - Gorilla and the Exam
Language: c++17 

Code 1:
#include <bits/stdc++.h>
using namespace std;

#define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

void solve() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    sort(a.begin(), a.end());
    vector<int> cnt = {1};
    for (int i = 1; i < n; i++) {
        if (a[i] == a[i - 1]) {
            cnt.back()++;
        } else {
            cnt.emplace_back(1);
        }
    }
    sort(cnt.begin(), cnt.end());
    int m = cnt.size();
    for (int i = 0; i < m - 1; i++) {
        if (cnt[i] > k) {
            cout << m - i << "\n";
            return;
        }
        k -= cnt[i];
    }
    cout << 1 << "\n";
}

int main() {
    fast_io;
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}


Code 2:
#include <bits/stdc++.h>
using namespace std;

#define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

int main() {
    fast_io;
    int t;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        vector<int> arr(n);
        for (int i = 0; i < n; ++i) {
            cin >> arr[i];
        }

        // Step 1: Calculate frequencies
        int max_val = *max_element(arr.begin(), arr.end());
        vector<int> freq(max_val + 1, 0);
        for (int num : arr) {
            freq[num]++;
        }

        // Step 2: Remove zeros and sort frequencies
        vector<int> counts;
        for (int count : freq) {
            if (count > 0) {
                counts.push_back(count);
            }
        }
        sort(counts.begin(), counts.end()); // Sort by frequency (ascending)

        // Step 3: Use k to reduce frequencies
        for (int i = 0; i < counts.size() && k > 0; ++i) {
            if (k >= counts[i]) {
                k -= counts[i]; // Use all occurrences of this element
                counts[i] = 0;  // Mark as removed
            } else {
                counts[i] -= k; // Reduce remaining frequency
                k = 0;          // All of k is used
            }
        }

        // Step 4: Count remaining distinct elements
        int cnt = 0;
        for (int count : counts) {
            if (count > 0) {
                cnt++;
            }
        }

        // If no distinct elements are left, output 1
        cout << (cnt == 0 ? 1 : cnt) << endl;
    }

    return 0;
}


Answer: 1
Problem: 2057B - Gorilla and the Exam
Language: c++17 

Code 1:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define mp make_pair
constexpr int mod=(int)2*1e5+7;
bool ct=false;

inline void solve(){
    int n,k;
    cin>>n>>k;
    vector<int>v(n);
    unordered_map<int,int>m;
    vector<int>s;
    for(auto it:v){
      cin>>it;
      m[it]++;
    }
    for(auto it:m){
      s.push_back(it.second);
    }
    sort(s.begin(),s.end());
    int ans=k;
    int c=0;
    for(int i=0;i<s.size();i++){
        if(s[i]<=ans) ans-=s[i],c++;
        else break;
    }
    if((s.size()-c)==0) cout<<1<<"\n";
    else cout<<s.size()-c<<"\n";
}

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll t=1;    
     cin>>t;
    while(t--) solve();
    return 0;
}
/*   /\_/\
*   (= ._.)
*   / >  \> 
  你好,                                                   
  操你 母狗!!
*/


Code 2:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
 
int solve(){
    int n,k,temp;
    cin>>n>>k;
    map<int, int> m;
 
    for(int i=0;i<n;i++){
        cin>>temp;
        m[temp]++;
    }
    vector<int> v;
    for(auto x:m){
        v.push_back(x.second);
    }
    sort(v.begin(),v.end());
    int ans=v.size();
    // cout<<"ans "<<ans<<endl;
 
    if(k==0){
        cout<<ans<<endl;
        return 0;
    }
 
    for(int i=0;i<v.size();i++){
        k-=v[i];
        if(k<0){
            break;
        }
        ans--;
    }
    cout<<max(ans,1)<<endl;
    return 0;
}
int main()
{
    int testCase=1;
    cin>>testCase;
    while(testCase--){
        solve();
    }
    return 0;
}

Answer: 2
Problem: 2057B - Gorilla and the Exam
Language: c++17 

Code 1:
#include<bits/stdc++.h>
#define int long long
using namespace std;
map<int,int>mp;
vector<int>num;
int n,m,idt,x;
void solve(){
	mp.clear();
	num.clear();
	scanf("%lld%lld",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%lld",&x);
		mp[x]++;
	}
	for(auto _:mp){
		num.push_back(_.second);
	}
	sort(num.begin(),num.end());
	bool flag=false;
	int s=num.size();
	for(int i=0;i<s;i++){
		if(m>=num[i]){
			m-=num[i];
		}
		else{
			printf("%lld\n",s-i);
			flag=true;
			return;
		}
	}
	printf("1\n");
}
signed main(){
#ifdef USE_FILE_IO
	freopen("code.in","r",stdin);
	freopen("code.out","w",stdout);
#endif
	int t;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

Code 2:
#include<bits/stdc++.h>
#define int long long
using namespace std;
unordered_map<int,int>mp;
int tot[200005];
int n,m,idt,x;
void solve(){
	idt=0;
	mp.clear();
	for(int i=1;i<=n;i++){
		tot[i]=0;
	}
	scanf("%lld%lld",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%lld",&x);
		if(mp[x]==0){
			mp[x]=++idt;
		}
		x=mp[x];
		tot[x]++;
	}
	int ans=idt;
	sort(tot+1,tot+idt+1);
	for(int i=1;i<idt;i++){
		if(m<=0)break;
		if(tot[i]<=m){
			m-=tot[i];
		}
		ans--;
	}
	printf("%lld\n",ans);
}
signed main(){
#ifdef USE_FILE_IO
	freopen("code.in","r",stdin);
	freopen("code.out","w",stdout);
#endif
	int t;
	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

Answer: 1
Problem: 2057B - Gorilla and the Exam
Language: c++20 

Code 1:
#include <bits/stdc++.h>
#define ll long long
using namespace std;

ll t, n, k, x, ans;
set<ll> a;
multiset<ll> b;
priority_queue <ll, vector<ll>, greater<ll>> pq;

int main() {
    cin >> t;
    for(ll T = 1; T <= t; T++) {
        cin >> n >> k;
        a.clear();
        b.clear();
        for(ll i = 1; i <= n; i++) {
            cin >> x;
            a.insert(x);
            b.insert(x);
        }
        ans = a.size();
        pq = priority_queue <ll, vector<ll>, greater<ll>>();
        for(ll i : a) {
            pq.push(b.count(i));
            cout << i << "/" << b.count(i) << " ";
        }
        cout << "\n";
        while(pq.size() > 1) {
            if(k >= pq.top()) {
                k -= pq.top();
                ans--;
                pq.pop();
            } else break;
        }
        cout << ans << "\n\n";
    }
}

Code 2:
#include <bits/stdc++.h>
#define ll long long
using namespace std;

ll t, n, k, x, ans;
set<ll> a;
multiset<ll> b;
priority_queue <ll, vector<ll>, greater<ll>> pq;

int main() {
    cin >> t;
    for(ll T = 1; T <= t; T++) {
        cin >> n >> k;
        a.clear();
        b.clear();
        for(ll i = 1; i <= n; i++) {
            cin >> x;
            a.insert(x);
            b.insert(x);
        }
        ans = a.size();
        pq = priority_queue <ll, vector<ll>, greater<ll>>();
        for(ll i : a) {
            pq.push(b.count(i));
        }
        while(pq.size() > 1) {
            if(k >= pq.top()) {
                k -= pq.top();
                ans--;
                pq.pop();
            } else break;
        }
        cout << ans << "\n";
    }
}

Answer: 2
Problem: 2057B - Gorilla and the Exam
Language: c++17 

Code 1:
#include <bits/stdc++.h>
using namespace std;

void solve(){
    int n, k;
    cin>>n>>k;
    vector<int> v(n), f;
    map<int, int> m;
    for(int i = 0; i < n; i++){
        cin>>v[i];
        m[v[i]]++;
    }
    if(k >= n){
        cout<<1<<endl;
        return;
    }
    int ct = 0;
    for(auto it: m){
        if(it.second > k) ct++;
        else f.push_back(it.second);
    }
    sort(f.begin(), f.end());
    for(int j = 0; j < f.size(); j++){
        if(k >= f[j]) {
            k -= f[j];
        }
        else ct++;
    }
    cout<<ct<<"\n";
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin>>t;
    while(t--) solve();
}

Code 2:
#include <bits/stdc++.h>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin>>t;
    while(t--){
        int n, k;
        cin>>n>>k;
        vector<int> v(n);
        set<int> s;
        int mini = INT_MAX, cm = INT_MAX;
        int p = 0;
        for(int i = 0; i < n; i++){
            int a;
            cin>>a;
            v[i] = a;
            if(k == 0){
                s.insert(a);
            }
            else if(k == 1){
                mini = min(mini, a);
                s.insert(mini);
            }
        }
        if(k > 1){
            for(int i = 0; i < n; i+=k){
                cm = v[i];
                for(int j = 1; j < k; j++){
                    if(j+i > n) break;
                    cm = min(cm, v[(j+i)]);
                }
                s.insert(cm);
            }
        }
        cout<<s.size()<<"\n";
    }
}

Answer: 1
Problem: 2057B - Gorilla and the Exam
Language: c++20 

Code 1:


#include <bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long
#define MOD 1000000007


signed main() {
    fastio();
    int test;
    cin >> test;


    while (test--) {
        int n,m,k;
        cin >>n>>k;
        unordered_map<int,int>mp;
        int y=0,ans=0;
        
        vector<int> a(n),ele;
        for (int i = 0; i < n; i++) {
            cin>>a[i];
        }
        sort(a.begin(),a.end());
        int c=1;
        for (int i = 1; i < n; i++) {
            if(a[i]==a[i-1]){
                c++;
            }
            else{
                ele.push_back(c);
                c=1;
            }
        }
        ele.push_back(c);
        sort(ele.begin(),ele.end());
        int i=0;
        while(i<ele.size() && ele[i]<=k){
            // cout<<ele[i]<<" ";
            k-=ele[i];
            ele[i]=0;
            i++;
        }
        
        // for (int i = 0; i < n; i++) {
        //     cout<<a[i]<<" ";
        // }
        if(i==ele.size()) cout<<1<<endl;
        else
        cout<<ele.size()-i<<endl;
    }
 
    return 0;
}

Code 2:


#include <bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long
#define MOD 1000000007


signed main() {
    fastio();
    int test;
    cin >> test;


    while (test--) {
        int n,m,k;
        cin >>n>>k;
        unordered_map<int,int>mp;
        int y=0,ans=0;
        
        vector<int> a(n),ele;
        for (int i = 0; i < n; i++) {
            cin>>a[i];
        }
        sort(a.begin(),a.end());
        int c=1;
        for (int i = 1; i < n; i++) {
            if(a[i]==a[i-1]){
                c++;
            }
            else{
                ele.push_back(c);
                c=1;
            }
        }
        sort(ele.begin(),ele.end());
        int i=0;
        while(i<ele.size() && ele[i]<=k){
            // cout<<ele[i]<<" ";
            k-=ele[i];
            ele[i]=0;
            i++;
        }
        
        // for (int i = 0; i < n; i++) {
        //     cout<<a[i]<<" ";
        // }
        cout<<ele.size()-i+1<<endl;
    }
 
    return 0;
}

Answer: 1
Problem: 2057B - Gorilla and the Exam
Language: c++20 

Code 1:
#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;cin>>t;
	while(t--){
		long long n,m=0,j,count=1,k,x;cin>>n>>k;
		vector<long long>v(n),a(n);set<long long>s;
		for(long long i=0;i<n;i++){cin>>v[i];}sort(v.begin(),v.end());
        for(long long i=0;i<n-1;i++){
            if(v[i]==v[i+1]){count++;}
            else{count=1;}
            m=max(count,m);
        }
        //cout<<m<<endl;

        /*for(long long i=n-1;i>=0;i--){
            if(v[i]!=x){k--;}
            if(k==0){j=i;break;}
        }*/
        if(m>k||m==1){m=0;}
        for(long long i=0;i<n-k-m;i++){
            s.insert(v[i]);
        }if(n==k||n-k-m<=0){cout<<"1"<<endl;}else{
        cout<<s.size()<<endl;}
    }
}

Code 2:
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;cin>>t;
    while(t--){
        long long n,k;cin>>n>>k;
        vector<long long>v(n);
        map<long long,long long>m;
        for(long long i=0;i<n;i++){cin>>v[i];m[v[i]]++;}
        vector<long long>a;
        for(auto& [x,y]:m){a.push_back(y);}
        sort(a.begin(),a.end());
        long long ans=a.size();
        for(long long i=0;i<a.size()-1;i++){if(k>=a[i]){k-=a[i];ans--;}}
        cout<<ans<<endl;
    }
}

Answer: 2
Problem: 2057B - Gorilla and the Exam
Language: c++17 

Code 1:
#include<iostream>
#include<map>
using namespace std;
int main(){
                    int t;
                    cin>>t;
                    unordered_map<int,int>mp;
                    while(t--){
                             int n,k;
                             cin>>n>>k;
                             int a[];
                             mp.clear();
                             for(int i=0; i<n; i++){
                                                 cin>>a[i];
                                                 mp[a[i]]++;
                             }
                             multiset<int>st;
                             for(auto b:mp){
                                                 st.push(b.second);
                             }
                             int ans = st.size();
                             for(auto a : st){
                                                 if(k>=a){
                                                                     ans--;
                                                                     m-=a;
                                                 }
                             }
                             cout<<ans<<endl;
                             
                    }
                    return 0;
}

Code 2:
#include <bits/stdc++.h>
using namespace std;
map<int,int>mp;
int main()
{
	int t;
	cin>>t;
	while(t--){
		long long n,m;
		cin>>n>>m;
		mp.clear();
		for(int i=1;i<=n;i++){
			int a;
			cin>>a;
			mp[a]++;
		}
		multiset<int>st;
		for(auto b:mp)
			st.insert(b.second);
		int ans=st.size();
		for(int a:st){
			if(m>=a)ans--,m-=a;
		}cout<<max(1,ans)<<'\n';
	}
}

Answer: 2
Problem: 2057B - Gorilla and the Exam
Language: c++17 

Code 1:
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;


void solver() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int input; cin >> input;
    while(input--) {
        int n, k; cin >> n >> k;
        map<int, int> map;
        int num;
        for(int i = 0; i < n; i++) {
            cin >> num;
            map[num]++;
        }

        vector<int> vec;
        for(auto ele: map) vec.push_back(ele.second);
        sort(vec.begin(), vec.end());

        int passes = vec.size();

        for(int i = 0; k > 0 && i < vec.size() - 1; i++) {
            int temp = min(vec[i], k);
            vec[i] -= temp;
            k -= temp;
            if(vec[i] == 0) passes--;
        }

        cout << passes << "\n";
    }
}


int main(){

    solver();

}


Code 2:
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;


void solver() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int input; cin >> input;
    while(input--) {
        int n, k; cin >> n >> k;
        unordered_map<int, int> map;
        int num;
        for(int i = 0; i < n; i++) {
            cin >> num;
            map[num]++;
        }

        vector<int> vec;
        for(auto ele: map) vec.push_back(ele.second);
        sort(vec.begin(), vec.end());

        int passes = vec.size();

        for(int i = 0; k > 0 && i < vec.size() - 1; i++) {
            if(k >= vec[i]) {
                k -= vec[i];
                vec[i] = 0;
                passes--;
            }
            else break;
        }

        cout << passes << "\n";
    }
}


int main(){

    solver();
;
}


Answer: 1
Problem: 2057B - Gorilla and the Exam
Language: c++20 

Code 1:
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

// 1,2,3,4,5,6,7,8
//1,4,9,16,25,36,49

#define NMAX (4*100005)


void solve() {
    int n, k; cin >> n >> k;
    map<int, int> mp;
    for (int i = 0; i < n; i++) {
        int aux; cin >> aux;
        mp[aux]++;
    }

    int arr[n];
    fill(arr, arr+n, INT_MAX);
    int i = 0;
    for (auto [first, second] : mp) {
        // cout << second << " ";
        arr[i] = second;
        i++;
    }
    // cout << endl << " -> ";
    sort(arr, arr+n);
    for (int i = 0; i < n; i++) {
        if (arr[i] <= k) {
            k = k-arr[i];
        } else {
            cout << mp.size() - i << endl;
            return;
        }
    }
    cout << 1 << endl;

}

int main() {
    int t; cin >> t;
    while (t--) solve();
    return 0;
}

Code 2:
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

// 1,2,3,4,5,6,7,8
//1,4,9,16,25,36,49

#define NMAX (4*100005)


void solve() {
    int n, k; cin >> n >> k;
    map<int, int> mp;
    for (int i = 0; i < n; i++) {
        int aux; cin >> aux;
        mp[aux]++;
    }

    int arr[n];
    fill(arr, arr+n, INT_MAX);
    int i = 0;
    for (auto [first, second] : mp) {
        // cout << second << " ";
        arr[i] = second;
        i++;
    }
    // cout << endl << " -> ";
    sort(arr, arr+n);
    for (int i = 0; i < n; i++) {
        if (arr[i] <= k) {
            k = k-arr[i];
        } else {
            if (mp.size() - i  == 0) cout << 1 << endl;
            else cout << mp.size() - i << endl;
            return;
        }
    }
    cout << 1 << endl;

}

int main() {
    int t; cin >> t;
    while (t--) solve();
    return 0;
}

Answer: 2
Problem: 2057B - Gorilla and the Exam
Language: c++20 

Code 1:
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define optimize() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main(){
    optimize();
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        int arr[n];
        map<int,int>mp;
        for(int i=0;i<n;i++)
        {
         cin>>arr[i];
         mp[arr[i]]++;
        }
        vector<int>v;
        for(auto u:mp)v.push_back(u.second);
         sort(v.begin(),v.end());
         int cnt=v.size();
        for(auto u:v)
        {
         if(u<=k)
          {
            cnt--;
            k=k-u;
          }
        }
        cout<<max(1,cnt)<<endl;
    }
    return 0;
}


Code 2:
#include<bits/stdc++.h>
using namespace std;
#define endlb'\n'
#define ll long long
#define optimize() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main(){
    optimize();
    int t;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        vector<int>arr(n);
        unordered_map<int,int>freq_map;
        for(int i=0;i<n;i++){
            cin>>arr[i];
            freq_map[arr[i]]++;
        }
        vector<pair<int,int>>freq_vec;
        for(auto&entry:freq_map){
            freq_vec.push_back(entry);
        }
        sort(freq_vec.begin(),freq_vec.end(),[](pair<int,int>&a,pair<int,int>&b){
            return a.second<b.second;
        });
        int cnt=0;
        for(auto&u:freq_vec){
            if(u.second<=k){
                k-=u.second;
                u.second=0;
            }
        }
 
        for(auto&u:freq_vec){
            if(u.second!=0)cnt++;
        }
        if(cnt==0)cout<<1<<endl;
        else cout<<cnt<<endl;
    }
    return 0;
}


Answer: 1
Problem: 2057B - Gorilla and the Exam
Language: c++17 

Code 1:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() 
{
    int t;
    cin>>t;
    while(t--){
      int n, k;
      cin>>n>>k;
      vector<ll> vec;
      for(int i=0; i<n; i++){
        ll x;
        cin>>x;
        vec.push_back(x);
      }
      map<int, int> mp;
      for(int i=0; i<vec.size(); i++){
        mp[vec[i]]++;
      }
      vector<vector<int>> kv;
      for(auto i:mp){
        vector<int> ins(2);
        ins[0] = i.second;
        ins[1] = i.first;
        kv.push_back(ins);
      }
      sort(kv.begin(), kv.end());
      int i=0;
      while(k>0 && i<kv.size()){
        if(k>=kv[i][0]){
          k-=kv[i][0];
          i++;
        }
        else{
          break;
        }
      }
      if(i == kv.size()) cout<<1<<endl;
      else{
      cout<<kv.size()-i<<endl;
      }
    }
    return 0;
}

Code 2:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() 
{
    int t;
    cin>>t;
    while(t--){
      int n, k;
      cin>>n>>k;
      vector<ll> vec;
      for(int i=0; i<n; i++){
        ll x;
        cin>>x;
        vec.push_back(x);
      }
      map<int, int> mp;
      for(int i=0; i<vec.size(); i++){
        mp[vec[i]]++;
      }
      vector<vector<int>> kv;
      for(auto i:mp){
        vector<int> ins(2);
        ins[0] = i.second;
        ins[1] = i.first;
        kv.push_back(ins);
      }
      sort(kv.begin(), kv.end());
      int i=0;
      while(k>0 && i<kv.size()){
        if(k>=kv[i][0]){
          k-=kv[i][0];
          i++;
        }
      }
      if(i == kv.size()) cout<<1<<endl;
      else{
      cout<<kv.size()-i<<endl;
      }
    }
    return 0;
}

Answer: 1