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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-
2
给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外) 给我点赞的父母平安,天天发财,考上清北,绝对有效!!!(lqst2502除外)
-
1
#include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } -
0
#include<bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10; int a[N],b[N]; void solve() { priority_queue<int,vector<int>,greater<int>>q; int n,m,k; cin>>n>>m>>k; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { if(k>0) { k--; q.push(a[i]); } else { if(q.size()&&q.top()<a[i]) { m-=q.top(); q.pop(); q.push(a[i]); } else { m-=a[i]; } } if(m<=0) { cout<<i-1<<endl; return; } } cout<<n<<endl; } signed main() { //freopen("spire.in","r",stdin); //freopen("spire.out","w",stdout); cin.tie(0)->sync_with_stdio(0); cout.tie(0); int T; cin>>T; while(T--) { solve(); } return 0; } -
-1
@ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013) @ 刘丛睿 (lqst2025013)
- 1
Information
- ID
- 1324
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- (None)
- # Submissions
- 250
- Accepted
- 126
- Uploaded By
我们知道了同学数量和每个同学需要苹果的数量,那么: