Language: C++

// by adiforluls
#pragma GCC optimize ("-O2")
#include<bits/stdc++.h>
using namespace std;
#define fastestiointhewest   ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ll          long long
#define ld          long double
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define mii         map<int,int>
#define vi          vector<int>
#define vll         vector<long long>
#define lbnd        lower_bound
#define ubnd        upper_bound
#define all(a)      (a).begin(),(a).end()
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define lul         1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define SIZE        1000005
#define F           first
#define S           second
#define debug(x)    cerr << #x << " = " << x << endl;
#define mod         998244353

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " = " << arg1<<" |";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define endl        '\n'
const ld PI = acos(-1.0);
const int INF = 0x3f3f3f3f;

set<ll> s;
void solve()
{
   int n,m; cin>>n>>m;
   ll p[n];
   rep(i,0,n)
   {
     cin>>p[i].F>>p[i].S;
   }
   sort(p,p+n);
   ll ans=0;
   rep(i,0,n)
   {
      ans+=min(p[i].S,m)*p[i].F;
      m-=p[i].S;
      if(m<=0) break;
   }
   cout<<ans;
}  
int main()
{   
    fastestiointhewest;
   //  #ifndef ONLINE_JUDGE
     // freopen("input.txt", "r", stdin);
     // freopen("output.txt", "w", stdout);
   //  #endif
    int t; t=1;
    while(t--){
       solve();
    }
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:23:21: error: request for member 'first' in 'p[i]', which is of non-class type 'long long int'
   23 | #define F           first
      |                     ^~~~~
a.cc:55:16: note: in expansion of macro 'F'
   55 |      cin>>p[i].F>>p[i].S;
      |                ^
a.cc:24:21: error: request for member 'second' in 'p[i]', which is of non-class type 'long long int'
   24 | #define S           second
      |                     ^~~~~~
a.cc:55:24: note: in expansion of macro 'S'
   55 |      cin>>p[i].F>>p[i].S;
      |                        ^
a.cc:24:21: error: request for member 'second' in 'p[i]', which is of non-class type 'long long int'
   24 | #define S           second
      |                     ^~~~~~
a.cc:61:21: note: in expansion of macro 'S'
   61 |       ans+=min(p[i].S,m)*p[i].F;
      |                     ^
a.cc:23:21: error: request for member 'first' in 'p[i]', which is of non-class type 'long long int'
   23 | #define F           first
      |                     ^~~~~
a.cc:61:31: note: in expansion of macro 'F'
   61 |       ans+=min(p[i].S,m)*p[i].F;
      |                               ^
a.cc:24:21: error: request for member 'second' in 'p[i]', which is of non-class type 'long long int'
   24 | #define S           second
      |                     ^~~~~~
a.cc:62:15: note: in expansion of macro 'S'
   62 |       m-=p[i].S;
      |               ^