Language: C++

#include <bits/stdc++.h>
using namespace std;
#typedef long long ll;
#define MAX 100010
#define INF 2000000000
ll n, h;
ll w[MAX], t[MAX];

int main()
{
	cin >> n >> h;

	for (int i = 0; i < n; i++)
	{
		cin >> w[i] >> t[i];
	}

	ll max_wield = 0;
	for (int i = 0; i < n; i++)
	{
		max_wield = max(max_wield, w[i]);
	}
	
	sort(t, t + n);
	reverse(t, t + n);
	
	ll sum_throw = 0;
	ll count_throw = n;
	
	for (int i = 0; i < n; i++)
	{
		sum_throw += t[i];
		if (sum_throw >= h)
		{
				cout << i + 1 << endl;
				return 0;
		}
	}
	
	for (int i = 0; i < n; i++)
	{
		if (t[i] < max_wield)
		{
			count_throw--;
			sum_throw -= t[i];
		}
	}
	
	h -= sum_throw;

	ll ans = 0;
	if (h % max_wield != 0)
	{
		ans = 1;
	}
	
	ans = ans + h / max_wield + count_throw;
	
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #typedef
    3 | #typedef long long ll;
      |  ^~~~~~~
a.cc:6:1: error: 'll' does not name a type
    6 | ll n, h;
      | ^~
a.cc:7:1: error: 'll' does not name a type
    7 | ll w[MAX], t[MAX];
      | ^~
a.cc: In function 'int main()':
a.cc:11:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |         cin >> n >> h;
      |                ^
      |                yn
a.cc:11:21: error: 'h' was not declared in this scope
   11 |         cin >> n >> h;
      |                     ^
a.cc:15:24: error: 'w' was not declared in this scope
   15 |                 cin >> w[i] >> t[i];
      |                        ^
a.cc:15:32: error: 't' was not declared in this scope
   15 |                 cin >> w[i] >> t[i];
      |                                ^
a.cc:18:9: error: 'll' was not declared in this scope
   18 |         ll max_wield = 0;
      |         ^~
a.cc:21:17: error: 'max_wield' was not declared in this scope
   21 |                 max_wield = max(max_wield, w[i]);
      |                 ^~~~~~~~~
a.cc:21:44: error: 'w' was not declared in this scope
   21 |                 max_wield = max(max_wield, w[i]);
      |                                            ^
a.cc:24:14: error: 't' was not declared in this scope; did you mean 'tm'?
   24 |         sort(t, t + n);
      |              ^
      |              tm
a.cc:27:11: error: expected ';' before 'sum_throw'
   27 |         ll sum_throw = 0;
      |           ^~~~~~~~~~
      |           ;
a.cc:28:11: error: expected ';' before 'count_throw'
   28 |         ll count_throw = n;
      |           ^~~~~~~~~~~~
      |           ;
a.cc:32:17: error: 'sum_throw' was not declared in this scope
   32 |                 sum_throw += t[i];
      |                 ^~~~~~~~~
a.cc:42:28: error: 'max_wield' was not declared in this scope
   42 |                 if (t[i] < max_wield)
      |                            ^~~~~~~~~
a.cc:44:25: error: 'count_throw' was not declared in this scope
   44 |                         count_throw--;
      |                         ^~~~~~~~~~~
a.cc:45:25: error: 'sum_throw' was not declared in this scope
   45 |                         sum_throw -= t[i];
      |                         ^~~~~~~~~
a.cc:49:14: error: 'sum_throw' was not declared in this scope
   49 |         h -= sum_throw;
      |              ^~~~~~~~~
a.cc:51:11: error: expected ';' before 'ans'
   51 |         ll ans = 0;
      |           ^~~~
      |           ;
a.cc:52:17: error: 'max_wield' was not declared in this scope
   52 |         if (h % max_wield != 0)
      |                 ^~~~~~~~~
a.cc:54:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |                 ans = 1;
      |                 ^~~
      |                 abs
a.cc:57:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   57 |         ans = ans + h / max_wield + count_throw;
      |         ^~~
      |         abs
a.cc:57:25: error: 'max_wield' was not declared in this scope
   57 |         ans = ans + h / max_wield + count_throw;
      |                         ^~~~~~~~~
a.cc:57:37: error: 'count_throw' was not declared in this scope
   57 |         ans = ans + h / max_wield + count_throw;
      |                                     ^~~~~~~~~~~