Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main(){
- cin.tie(0);
- ios_base::sync_with_stdio(false);
- int n,x;
- cin>>n>>x;
- int a[n];
- for(int i=0;i<n;i++){
- cin>>a[i];
- }
- sort(a,a+n);
- int count=0;
- int product=1;
- for(int i=n-1;i>=0;i--){
- product=product*a[i];
- if(product>=x){
- count++;
- product=1;
- }
- }
- cout<<count<<"\n";
- }
Add Comment
Please, Sign In to add comment