unittest
{
	assert( [ "1 10", "3 5" ].parse.expand.solve == 3 );
	assert( [ "2 10", "3 5", "2 6" ].parse.expand.solve == 2 );
	assert( [ "4 1000000000", "1 1", "1 10000000", "1 30000000", "1 99999999" ].parse.expand.solve == 860000004 );
	assert( [ "5 500", "35 44", "28 83", "46 62", "31 79", "40 43" ].parse.expand.solve == 9 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nh = input.front.split.to!( long[] );
	auto as = new long[ nh[ 0 ] ];
	auto bs = new long[ nh[ 0 ] ];
	foreach( ref a, ref b; lockstep( as, bs ) )
	{
		input.popFront;
		auto ab = input.front.split.to!( long[] );
		a = ab[ 0 ];
		b = ab[ 1 ];
	}
	return tuple( nh[ 1 ], as, bs );
}

auto solve( long h, long[] as, long[] bs )
{
	// 振る用の刀を判定（一番強いやつだけ使う）
	auto am = as.reduce!( max );
	
	// 投げる用の刀を判定（振る用より強いやつだけ使う）
	auto bms = bs.sort!( ( x, y ) => y < x ).filterBidirectional!( ( b ) => am < b );
	
	// 攻撃回数を計算（強い順に使う）
	auto ans = 0L;
	foreach( bm; bms )
	{
		if( h <= 0 ) break;
		h -= bm;
		ans++;
	}
	if( 0 < h ) ans += ( h + am - 1 ) / am;
	return ans;
}
