Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <st#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <string.h>
#include <map>
#include <bitset>

#define Z class
#define ln cout<<'\n'
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=97, A=65
// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
// sort(vec.begin(), vec.end()); std::greater<>()
// reverse(vec.begin(), vec.end());
// scanf("%s",s);
// printf("%d\n",end-start+1);
// ceil (a + (b - 1)) / b

using namespace std;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
using pll = pair<long long, long long>;

template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;

int main(){
    ll N, M; cin >> N >> M;
    vector<pll> p(N);
    rep (i, N) {
        cin >> p[i].first >> p[i].second;
    }
    sort(p.begin(), p.end());
    
    ll res = 0;
    for(int i = 0; i < N &&  M > 0; i++) {
            res += p[i].first * min(M, p[i].second);
            M -= min(M, p[i].second);
    }
    cout << res << endl;
}


ring.h>
#include <map>
#include <bitset>

#define Z class
#define ln cout<<'\n'
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=97, A=65
// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
// sort(vec.begin(), vec.end()); std::greater<>()
// reverse(vec.begin(), vec.end());
// scanf("%s",s);
// printf("%d\n",end-start+1);
// ceil (a + (b - 1)) / b

using namespace std;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
using pll = pair<long long, long long>;

template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;

pair<ll, ll> p[10010];
int main(){
    ll N, M; cin >> N >> M;
    ll res = 0;
    rep (i, N) {
        cin >> p[i].first >> p[i].second;
    }
    sort(p, p + N);
    
    ll cnt = 0;
    rep (i, N) {
        if (cnt + p[i].second < M) {
            res += p[i].first * p[i].second;
            cnt += p[i].second;
            if(cnt == M) break;
        } else {
            res += p[i].first * (M - cnt);
            break;
        }
    }
    cout << res << endl;
}




Compiler output:
a.cc:11:10: fatal error: st#include <iostream: No such file or directory
   11 | #include <st#include <iostream>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.