#include<bits/stdc++.h>
using namespace std;
typedef long long int64;

typedef pair< int, int > Pi;
const int S = 100000;
const int64 INF = 1LL << 55;
 

int Dijkstra(int s, int g, vector< int64 >& d, vector< int64 >& c) { //s??????g???????????????
  typedef pair< int, int > Pi;
  priority_queue< Pi, vector< Pi >, greater< Pi > > que;
  vector< int > min_cost;
  min_cost.resize(300001, -1);
  que.push( Pi( 0, s));
  min_cost[s] = 0;
  while(!que.empty()){
    Pi p = que.top(); que.pop();
    if(p.second == g) return p.first;
    if(p.first > min_cost[p.second]) continue;
    for(int i = 0; i < d.size(); i++){
      int to = p.second + d[i];
      if(to <= 300000 && (min_cost[to] == -1 || p.first + c[i] < min_cost[to])){
        min_cost[to] = p.first + c[i];
        que.push( Pi( min_cost[to], to));
      }
      to = p.second - d[i];
      if(to >= 0 && (min_cost[to] == -1 || p.first + c[i] < min_cost[to])){
        min_cost[to] = p.first + c[i];
        que.push( Pi( min_cost[to], to));
      }
    }
  }
  return -1;
}

int main() {
  int N, x;
  cin >> N >> x;
  vector< int64 > d(N), c(N);
  for(int i = 0; i < N; i++){
    cin >> d[i] >> c[i];
  }
  cout << Dijkstra(S, S + x, d, c) << endl;
}
