using namespace std;
#include <bits/stdc++.h>
#define frr(i, r, l) for(int i = r; i >= l; --i)
#define fr(i, l, r) for(int i = l; i < r; ++i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define MEMS(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define m_p make_pair
#define pb push_back
#define ll long long
#define ld long double
typedef pair<ll, ll> iPair; 
priority_queue< ll, vector <ll> , greater<ll>>pq1,pq2;
#define maxN 1000000000000000000
ll power(ll a,ll b){ll res=1;while(b>0){if(b%2!=0)res=res*a;b/=2; a=a*a;}return res;}
int main()
{
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,cnt=0,ans=0,tot=0,x,y;
    vector<ll>v;
    cin>>n;
    fr(i,0,n)
    {
        cin>>x>>y;
        tot+=x;
        v.pb(y+2*x);

    }
    sort(v.begin(),v.end());

    frr(i,v.size()-1,0)
    {
        ans+=v[i];
        cnt++;
        if(ans>tot)
        {
            cout<<cnt<<endl;
            return 0;
        }
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define clr(a) memset(a, 0, sizeof(a))
#define full(a) memset(a, 0x3f, sizeof(a))
#define fornext(x, i) for(int i = head[x], y = ver[i]; i; i = nxt[i], y = ver[i])
#define mset(a, b) memset(a, b, sizeof(a))
#define Rep(i, a, b) for(int i = (a); i <= (b); ++i)
#define dRep(i, a, b) for(int i = (a); i >= (b); --i)
#define IOset(a) freopen(a".in", "r", stdin), freopen(a".out", "w", stdout);
#define endl '\n'
#define int ll
#define un unsigned
#define ll long long
#define db double
#define rept cerr<<1.0*clock()/CLOCKS_PER_SEC<<endl;
#define dbg cout<<"c "

template<typename _T>
inline void rd(_T &_d) {
	int _f; char _c;
	_f=_d=0;
	while(_c=getchar(),!isdigit(_c)) if (_c=='-') _f=1;
	while(isdigit(_c)) _d=_d*10+_c-'0',_c=getchar();
	if (_f) _d=-_d;
}

template <typename _T,typename ...Args>
inline void rd(_T &_d,Args &..._a) {
	rd(_d);
	rd(_a...);
}

#define mod(x) (x=(x>=M?x-M:x))
const int N=2e5+5,M=998244353;
int n,k,c[305][305],a[N],p[N][305],s[305];

signed main() {
	rd(n,k);
	Rep(i,1,n) rd(a[i]);
	Rep(i,0,k) c[i][0]=1;
	Rep(i,1,k) Rep(j,1,k) c[i][j]=c[i-1][j]+c[i-1][j-1],mod(c[i][j]);
	int tmp;
	Rep(i,1,n) {
		tmp=1;
		Rep(j,1,k) tmp=tmp*a[i]%M,s[j]+=tmp,mod(s[j]),p[i][j]=tmp;
	}
	Rep(i,1,n) p[i][0]=1;
	s[0]=n;
	int ans,inv=499122177;
	Rep(i,1,k) {
		ans=0;
		Rep(j,0,i) {
			ans=(ans+c[i][j]*s[j]%M*s[i-j]%M+M-s[i]*c[i][j]%M)%M;
		}
		cout<<ans*inv%M<<endl;
	}
	return 0;
}