For this Question: N people are waiting in line to get food. The ith person takes Arr[i] amount of time to get food. A person is happy if the amount of time he has to wait is less than or equal to the amount of time he takes to get food. The time a person waits is the sum of time people in front of him take to get food. Now you have to rearrange the people in the line such that the maximum number of people in the line are happy and report the maximum number of people that can be happy.The first line of input contains a single integer N.
The second line of input contains N integers denoting Arr[i].

Constraints: 
1 <= N <= 100000
1 <= Arr[i] <= 1000000000Print the maximum number of people that can be happy after the rearrangement.Sample Input 
4
3 1 3 10

Sample Output
3

Explanation: 
The optimal arrangement is 1 3 10 3
This way person 1 waits 0 units so he is happy.
Person 2 waits for 1 unit so he is happy.
Person 3 waits for 4 units so is happy.
Person 4 waits 14 units so he is unhappy., I have written this Solution Code: #pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountll
#define m_p make_pair
#define infi 1e18+1
#define eps 0.000000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T>//usage rand<long long>()
T rand() {
    return uniform_int_distribution<T>()(rng);
}
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template<class T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
 
//////////////

typedef unsigned long long ull;
auto clk=clock();
#define all(x) x.begin(),x.end()
#define S second
#define F first
#define sz(x) ((long long)x.size())
#define int long long  
#define f80 __float128
#define pii pair<int,int>
/////////////
 
signed main(){
	#ifdef ANIKET_GOYAL
		freopen("inputf.in","r",stdin);
		freopen("outputf.in","w",stdout);
	#endif
	int n;
	cin >> n;
	int arr[n];
	for(int i = 0; i < n;i++) cin >> arr[i];
	sort(arr,arr+n);
	int cur=0;
	int ans = 0;
	for(int i = 0; i < n;i++){
		if(cur <= arr[i]) cur += arr[i],ans++;
	}
	cout << ans << endl;
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?