stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

#ifndef ONLINE_JUDGE

#define debug(x) cout << #x << ": " << x << endl

#else

#define debug(x)

#endif

using namespace std;

typedef long long ll;

const int maxn=2e5+7;

const int inf=0x3f3f3f3f;

const int mod=1e9+7;



int a[maxn];

ll sum[maxn];



int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0);

    ll n,m,v,p;

    cin>>n>>m>>v>>p;

    for(int i=1;i<=n;++i) cin>>a[i];

    sort(a+1,a+1+n);

    for(int i=1;i<=n;++i)

        sum[i]=sum[i-1]+a[i];

    int ans=p;

    for(int i=n-p;i>=1;--i)

    {

        if(a[i]+m<a[n-p+1]) break;

        else

        {

            if( m*v<=i*m+(p-1)*m+(a[i]+m)*(n-p+1-i)-(sum[n-p+1]-sum[i]) )

                ans++;

            else break;

        }

    }

    cout<<ans<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.475373915294858x):
#include <cstring>

#include <algorithm>

#include <cstdio>

#define int long long

#define ri register int

#define N 100005

using namespace std;

int n,m,v,p,t=0,ans,a[N]= {0};

template <typename T> inline void read(T &x) {

    T c=getchar(),f=0;

    for (; c<48||57<c; c=getchar()) if (c=='-') f=1;

    for (x=0; 48<=c&&c<=57; c=getchar()) x=(x<<3)+(x<<1)+(c^48);

    if (f) x=-x;

}

template <typename T> inline void print(T x) {

    if (x<0) x=-x,putchar('-');

    if (x>9) print(x/10);

    putchar(x%10+48);

}

signed main() {

	read(n),read(m),read(v),read(p),ans=p;

	for (ri i=1; i<=n; i++) read(a[i]);

	sort(a+1,a+1+n),reverse(a+1,a+1+n);

	for (ri i=p+1; i<=n; i++) {

		if (a[i]+m<a[p]) break;

		if (v<=(p-1)+(n-i+1)) ans++;

		else if ((v-p-n+i)*m<=t) ans++;

		else if (((v-p-n+i)*m-t-1)/(i-p)+1+a[p]<=a[i]+m) ans++;

		t+=a[p]-a[i];

	}

	print(ans),putchar('\n');

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <cassert>



using ll = long long;

const int maxn = 1e5+7;



ll n, m, v, p, a[maxn], pre[maxn];



bool gao(ll x) {

	ll posl = std::lower_bound(a+1, a+1+n, x)-(a);

	ll posr = std::upper_bound(a+1, a+1+n, x+m)-(a);

//	std::cout << x << ' ' << x+m << ' ' << posl << ' ' << a[posl] << ' ' << posr << ' ' << a[posr] << '\n';

	assert(posl > 0);

	assert(posr <= n+1);

	posr = std::min(posr, n-p+2);

	posl = std::min(posl, n-p+2);

	if (x+m < a[n-p+1]) {

		return false;

	}

	ll ans = (posl-1)*m+(p-1)*m;

	ans += (x+m)*(posr-posl)-(pre[posr-1]-pre[posl-1]);

//	std::cout << (posl-1+1)*m << ' ' << (p-1)*m << ' ' << (x+m)*(posr-posl) << ' ' << (pre[posr-1]-pre[posl-1]) << ' ';

//	std::cout << ans << ' ' << v*m << '\n';

//	std::cout << "----------\n";

	return ans >= (v*m);

}



int main(int argc, char *argv[]) {  

	std::ios::sync_with_stdio(false);

	std::cin.tie(0); 

	std::cin >> n >> m >> v >> p;

	for (int i = 1; i <= n; i++) {

		std::cin >> a[i];

	}

	std::sort(a+1, a+n+1);

	pre[0] = 0;

	for (int i = 1; i <= n; i++) {

		pre[i] = a[i] + pre[i-1];

	}

//	for (int i = 1; i <= n; i++) {

//		std::cerr << a[i] << " \n"[i==n];

//	}

//	std::cout << "----------\n";

	int res = 0;

	for (int i = 1; i <= n; i++) {

		if (gao(a[i])) {

			res++;

		}

	}

	std::cout << res << '\n';

}

// Faster C++ solution for the same problem (measured speedup: 5.465624452914164x):
#include <cstring>

#include <algorithm>

#include <cstdio>

#define int long long

#define ri register int

#define N 100005

using namespace std;

int n,m,v,p,t=0,ans,a[N]= {0};

template <typename T> inline void read(T &x) {

    T c=getchar(),f=0;

    for (; c<48||57<c; c=getchar()) if (c=='-') f=1;

    for (x=0; 48<=c&&c<=57; c=getchar()) x=(x<<3)+(x<<1)+(c^48);

    if (f) x=-x;

}

template <typename T> inline void print(T x) {

    if (x<0) x=-x,putchar('-');

    if (x>9) print(x/10);

    putchar(x%10+48);

}

signed main() {

	read(n),read(m),read(v),read(p),ans=p;

	for (ri i=1; i<=n; i++) read(a[i]);

	sort(a+1,a+1+n),reverse(a+1,a+1+n);

	for (ri i=p+1; i<=n; i++) {

		if (a[i]+m<a[p]) break;

		if (v<=(p-1)+(n-i+1)) ans++;

		else if ((v-p-n+i)*m<=t) ans++;

		else if (((v-p-n+i)*m-t-1)/(i-p)+1+a[p]<=a[i]+m) ans++;

		t+=a[p]-a[i];

	}

	print(ans),putchar('\n');

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long int

using namespace std;



const int MAX = 1e5+5;



const int MOD = 1e9 + 7;







int main()

{

    ios::sync_with_stdio(0);

    cin.tie(0);

    

    int a , b , c;

    cin>>a>>b>>c;

    cout<<min(a*b , c)<<endl;

    return 0;

   

}

// Faster C++ solution for the same problem (measured speedup: 5.328266675640882x):
#include<stdio.h>



int main()

{

	int n,a,b;

	scanf("%d%d%d",&n,&a,&b);

	int s = n*a;

	int y = b<s?b:s;

	printf("%d\n",y);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <iomanip>

#include <cmath>

#include <vector>

#include <set>

#include <map>

#include <algorithm>



using namespace std;



#define drobucs ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



int main() {

	drobucs;



	int n, a, b;

	cin >> n >> a >> b;



	if (a * n > b) {

		cout << b;

	}

	else {

		cout << a * n;

	}



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.324227190545798x):
#include<stdio.h>



int main()

{

	int n,a,b;

	scanf("%d%d%d",&n,&a,&b);

	int s = n*a;

	int y = b<s?b:s;

	printf("%d\n",y);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main() {

	long long a, b, c;

	cin >> a >> b >> c;

	cout << ((a*b < c) ? (a*b) : c);

	cout << endl;

	system("PAUSE");

}

// Faster C++ solution for the same problem (measured speedup: 5.272750408973891x):
#include<stdio.h>



int main()

{

	int n,a,b;

	scanf("%d%d%d",&n,&a,&b);

	int s = n*a;

	int y = b<s?b:s;

	printf("%d\n",y);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long int

using namespace std;



const int MAX = 1e5+5;



const int MOD = 1e9 + 7;







int main()

{

    ios::sync_with_stdio(0);

    cin.tie(0);

    

    int a , b , c;

    cin>>a>>b>>c;

    cout<<min(a*b , c)<<endl;

    return 0;

   

}

// Faster C++ solution for the same problem (measured speedup: 5.3280942206677215x):
#include <stdio.h>





int main()

{		

	int n, a, b;

	

	scanf("%d%d%d", &n, &a, &b);

	a *= n;

	printf("%d\n", a < b ? a : b);

				

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <iomanip>

#include <cmath>

#include <vector>

#include <set>

#include <map>

#include <algorithm>



using namespace std;



#define drobucs ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);



int main() {

	drobucs;



	int n, a, b;

	cin >> n >> a >> b;



	if (a * n > b) {

		cout << b;

	}

	else {

		cout << a * n;

	}



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.324054866314836x):
#include <stdio.h>





int main()

{		

	int n, a, b;

	

	scanf("%d%d%d", &n, &a, &b);

	a *= n;

	printf("%d\n", a < b ? a : b);

				

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main() {

	long long a, b, c;

	cin >> a >> b >> c;

	cout << ((a*b < c) ? (a*b) : c);

	cout << endl;

	system("PAUSE");

}

// Faster C++ solution for the same problem (measured speedup: 5.27257975084328x):
#include <stdio.h>





int main()

{		

	int n, a, b;

	

	scanf("%d%d%d", &n, &a, &b);

	a *= n;

	printf("%d\n", a < b ? a : b);

				

	return 0;

}
// Slower C++ solution:
/**

*   @Author : MeGA

*   @InitTime :02/08/20 16:03:05

*   @Idea : 

*

*

*

*

*

*

*

**/

#include <bits/stdc++.h>

using namespace std;

int main(){

#ifndef ONLINE_JUDGE

  // freopen("in","r",stdin);

  // freopen("out","w",stdout);

#endif



     ios::sync_with_stdio(false);

     cin.tie(0);

     int n,a,b;

     cin>>n>>a>>b;

     cout<<min(b,n*a)<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.3280942206677215x):
#include <stdio.h>





int main()

{		

	int n, a, b;

	

	scanf("%d%d%d", &n, &a, &b);

	a *= n;

	printf("%d\n", a < b ? a : b);

				

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define lp(i,n) for(int i = 0; i <n;i++)

#define all(x) (x).begin(),(x).end()

#define pb push_back

#define MP make_pair

#define SZ(v) ((int)((v).size()))

typedef long long ll;



const ll MOD = 1e9 + 7;

const int OO = (int)1e6;

const int N = (int)1e7;



void init(){

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

}



int main() {

	#   ifdef LOCAL_PROJECT

        freopen("in.txt", "r", stdin);

    #   endif

    int n,a,b;

    cin>>n>>a>>b;

    cout<<min(a*n,b);

    

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.249927738188408x):
#include <stdio.h>





int main()

{		

	int n, a, b;

	

	scanf("%d%d%d", &n, &a, &b);

	a *= n;

	printf("%d\n", a < b ? a : b);

				

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main(){

    int n,m,x,l;

    cin >> n >> m >> x;

    if(n*m>x)

        l = x;

    else

        l = n * m;

    cout << l << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.258713864271096x):
#include <stdio.h>





int main()

{		

	int n, a, b;

	

	scanf("%d%d%d", &n, &a, &b);

	a *= n;

	printf("%d\n", a < b ? a : b);

				

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int main()

{

    long long int a,b,c;

    cin >> a >> b >> c;

    if(a*b<=c)

        cout << a*b << endl;

    else

        cout << c << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.260977413159244x):
#include<stdio.h>

#include<algorithm>

using namespace std;

int main()

{

	int n,a,b;

	scanf("%d%d%d", &n, &a, &b);

	printf("%d", min(n*a, b));

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

using namespace std;

int main() {

    int N=0,A=0,B=0;

    cin>> N>>A>>B;

    int tmp = N*A;

    if(B<tmp){

        cout<<B<<endl;

    }else{

        cout<<tmp<<endl;

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.258913266921939x):
#include<stdio.h>



int main(){

	

	int a,b,c;

	

	scanf("%d %d %d",&a,&b,&c);

	

	int trip =a*b;

	

	if(trip<=c){

		

		printf("%d\n",trip);

		

	}

	

	else{

		

		printf("%d\n",c);

	}

	

	

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#pragma GCC optimize("Ofast", "unroll-loops")

#define ll long long 

#define pii pair<int, int>

#define ull unsigned ll

#define f first

#define s second

#define FOR(i,a,b) for (int i=(a); i<(b); i++)

#define REP(i,n) for (int i=0; i<(n); i++)

#define RREP(i,n) for (int i=(n-1); i>=0; i--)

#define ALL(x) x.begin(),x.end()

#define SZ(x) x.size()

#define SQ(x) (x)*(x)

#define MNTO(a,b) a = min(a,(__typeof__(a))(b))

#define MXTO(a,b) a = max(a,(__typeof__(a))(b))

#define pb push_back

#define debug(x) cerr<<#x<<" is "<<x<<endl

using namespace std;



// #define int ll



const int maxn = 1e5+5;

const int iinf = 1<<29;

const ll inf = 1ll<<60;

const ll mod = 1e9+7;





void GG(){cout<<"No\n"; exit(0);}



ll pow(ll a, ll n){ // a^n % mod

    ll re=1;

    while (n>0){

        if (n&1) re = re*a %mod;

        a = a*a %mod;

        n>>=1;

    }

    return re;

}



ll inv (ll b){

    if (b==1) return b;

    return (mod-mod/b) * inv(mod%b) % mod;

}



main(){

    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    int a, b, c; cin>>a>>b>>c; cout<<min(a*b,c)<<endl;



    

}

// Faster C++ solution for the same problem (measured speedup: 5.330502456109603x):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

int main()

{

    // freopen("a.in","r",stdin);

    // freopen("k.out","w",stdout);

    int n,a,b;scanf("%d %d %d",&n,&a,&b);

    printf("%d",min(n*a,b));

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main()

{

       int N, A, B,x,y;

       cin>> N >> A >> B;

       x=N*A;

       if(x<=B)

       {

              cout<< x<< endl;



       }

       else

       {

              cout<< B <<endl;

       }



}


// Faster C++ solution for the same problem (measured speedup: 5.262322281447106x):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

int main()

{

    // freopen("a.in","r",stdin);

    // freopen("k.out","w",stdout);

    int n,a,b;scanf("%d %d %d",&n,&a,&b);

    printf("%d",min(n*a,b));

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

typedef long long ll;

#define vstroku() to_string()

#define vchislo() to_ulong()

#define gcd(x,y) __builtin_gcd(x,y)

#define numberof1(x) __builtin_popcount(x)

#define povsemelementam(i,mnozh) for(auto i: mnozh)

#define podotrezok(i,j) substr(i-1,j) // like prefix sum, (i,j)=s[j]-s[i-1]

#define pb push_back

#define pf push_front

#define popf pop_front

#define popb pop_back 

#define pii pair <int, int>

#define F first

#define S second

#define mipletsplay ios_base::sync_with_stdio(0); cin.tie(0); 





using namespace std;

const ll INFLL = 1e18;

const int MAXN = 3e5;

const ll INF = 1e9;

const ll kek=998244353;



int main() {

mipletsplay;



int n,a,b;

cin>>n>>a>>b;

int k=min(a*n,b);

cout<<k;}

// Faster C++ solution for the same problem (measured speedup: 5.328043496625677x):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

int main()

{

    // freopen("a.in","r",stdin);

    // freopen("k.out","w",stdout);

    int n,a,b;scanf("%d %d %d",&n,&a,&b);

    printf("%d",min(n*a,b));

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

#include <string>

#include <cstdlib>

#include <algorithm>

#include <vector>

using namespace std;



int main(){

	int n, a, b;

	scanf("%d%d%d", &n, &a, &b);

	printf("%d", min(n*a,b));

};


// Faster C++ solution for the same problem (measured speedup: 5.193290126683652x):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

int main()

{

    // freopen("a.in","r",stdin);

    // freopen("k.out","w",stdout);

    int n,a,b;scanf("%d %d %d",&n,&a,&b);

    printf("%d",min(n*a,b));

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#pragma GCC optimize("Ofast", "unroll-loops")

#define ll long long 

#define pii pair<int, int>

#define ull unsigned ll

#define f first

#define s second

#define FOR(i,a,b) for (int i=(a); i<(b); i++)

#define REP(i,n) for (int i=0; i<(n); i++)

#define RREP(i,n) for (int i=(n-1); i>=0; i--)

#define ALL(x) x.begin(),x.end()

#define SZ(x) x.size()

#define SQ(x) (x)*(x)

#define MNTO(a,b) a = min(a,(__typeof__(a))(b))

#define MXTO(a,b) a = max(a,(__typeof__(a))(b))

#define pb push_back

#define debug(x) cerr<<#x<<" is "<<x<<endl

using namespace std;



// #define int ll



const int maxn = 1e5+5;

const int iinf = 1<<29;

const ll inf = 1ll<<60;

const ll mod = 1e9+7;





void GG(){cout<<"No\n"; exit(0);}



ll pow(ll a, ll n){ // a^n % mod

    ll re=1;

    while (n>0){

        if (n&1) re = re*a %mod;

        a = a*a %mod;

        n>>=1;

    }

    return re;

}



ll inv (ll b){

    if (b==1) return b;

    return (mod-mod/b) * inv(mod%b) % mod;

}



main(){

    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    int a, b, c; cin>>a>>b>>c; cout<<min(a*b,c)<<endl;



    

}

// Faster C++ solution for the same problem (measured speedup: 5.498480516672037x):
#include<stdio.h>



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    int n,a,b;

    io>>n>>a>>b;

    if(n*a<b)io<<n*a;

    else io<<b;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main()

{

       int N, A, B,x,y;

       cin>> N >> A >> B;

       x=N*A;

       if(x<=B)

       {

              cout<< x<< endl;



       }

       else

       {

              cout<< B <<endl;

       }



}


// Faster C++ solution for the same problem (measured speedup: 5.42815180655666x):
#include<stdio.h>



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    int n,a,b;

    io>>n>>a>>b;

    if(n*a<b)io<<n*a;

    else io<<b;

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

typedef long long ll;

#define vstroku() to_string()

#define vchislo() to_ulong()

#define gcd(x,y) __builtin_gcd(x,y)

#define numberof1(x) __builtin_popcount(x)

#define povsemelementam(i,mnozh) for(auto i: mnozh)

#define podotrezok(i,j) substr(i-1,j) // like prefix sum, (i,j)=s[j]-s[i-1]

#define pb push_back

#define pf push_front

#define popf pop_front

#define popb pop_back 

#define pii pair <int, int>

#define F first

#define S second

#define mipletsplay ios_base::sync_with_stdio(0); cin.tie(0); 





using namespace std;

const ll INFLL = 1e18;

const int MAXN = 3e5;

const ll INF = 1e9;

const ll kek=998244353;



int main() {

mipletsplay;



int n,a,b;

cin>>n>>a>>b;

int k=min(a*n,b);

cout<<k;}

// Faster C++ solution for the same problem (measured speedup: 5.495944068949711x):
#include<stdio.h>



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    int n,a,b;

    io>>n>>a>>b;

    if(n*a<b)io<<n*a;

    else io<<b;

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

#include <string>

#include <cstdlib>

#include <algorithm>

#include <vector>

using namespace std;



int main(){

	int n, a, b;

	scanf("%d%d%d", &n, &a, &b);

	printf("%d", min(n*a,b));

};


// Faster C++ solution for the same problem (measured speedup: 5.356944268221191x):
#include<stdio.h>



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    int n,a,b;

    io>>n>>a>>b;

    if(n*a<b)io<<n*a;

    else io<<b;

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

using namespace std;

	

int n,a,b;

int main(){

	scanf("%d%d%d",&n,&a,&b);

	if(n*a<b){ 

		printf("%d",(n*a)); 

	}else{

		printf("%d",b); 

	}

	return 0;

} 

// Faster C++ solution for the same problem (measured speedup: 5.35845434892315x):
#include<stdio.h>



class FIO

{

public:

    template<typename T>FIO& operator >>(T& x){ _R(x);return *this; }

    template<typename T>FIO& operator <<(T x){ _W(x);return *this; }

private:

    char f,c,a[25],i;

    template<typename T>inline void _R(T& x)

    {

        for(f=0;(c=getchar())<48;c==45&&(f=1));

        for(x=c^48;(c=getchar())>47;x=(x<<3)+(x<<1)+(c^48));

        if(f)x=-x;

    }

    template<typename T>inline void _W(T x)

    {

        if(sizeof(x)==1){ putchar(x);return; }

        if(x<0)putchar(45),x=-x;

        if(x>99) {

            for(i=0;x;x/=10)a[i++]=x%10;

            while(i--)putchar(a[i]+48);

        } else if(x>9) putchar(x/10+48),putchar(x%10+48);

        else putchar(x+48);

    }

}io;



int main()

{

    int n,a,b;

    io>>n>>a>>b;

    if(n*a<b)io<<n*a;

    else io<<b;

    return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <algorithm>

#include <cstring>

#include <cmath>

#include <vector>

using namespace std;

static_assert(sizeof(long) >= 8, "sizeof(long) >= 8");

constexpr int mod = 998244353;

long fac[100001], inv[100001];

int dp[10001];

int solve(int x, int y) {

    dp[0] = 1;

    for (int i = 1; i <= x; i++)

        for (int j = 1; j <= y; j++)

            dp[j] = (dp[j] + (long) i * dp[j - 1]) % mod;

    long ans = 0;

    for (int i = 0; i <= y; i++)

        ans = (ans + dp[i] * inv[x + i]) % mod;

    return ans * fac[x] % mod * fac[x] % mod * fac[y] % mod * fac[x + y] % mod;

}

char a[10001], b[10001];

int main() {

    fac[0] = 1;

    for (int i = 1; i <= 100000; i++)

        fac[i] = fac[i - 1] * i % mod;

    inv[100000] = 812950533;

    for (int i = 100000; i >= 1; i--)

        inv[i - 1] = inv[i] * i % mod;



    scanf("%s%s", a, b);

    int x = 0, y = 0;

    for (int i = 0; a[i]; i++)

        if (a[i] == '1')

            (b[i] == '0' ? x : y)++;

    printf("%d\n", solve(x, y));

}


// Faster C++ solution for the same problem (measured speedup: 4.296727487696516x):
#include <cstdio>

using namespace std;

static_assert(sizeof(long) >= 8, "sizeof(long) >= 8");

constexpr int mod = 998244353;

int fac[20001], inv[20001];

int dp[10001];

int solve(int x, int y) {

    dp[0] = 1;

    for (int i = 1; i <= x; i++)

        for (int j = 1; j <= y; j++)

            dp[j] = (dp[j] + (long) i * dp[j - 1]) % mod;

    int ans = 0;

    for (int i = 0; i <= y; i++)

        ans = (ans + (long) dp[i] * inv[x + i]) % mod;

    return (long) ans * fac[x] % mod

                      * fac[x] % mod

                      * fac[y] % mod

                      * fac[x + y] % mod;

}

char a[10001], b[10001];

int main() {

    fac[0] = 1;

    for (int i = 1; i <= 20000; i++)

        fac[i] = (long) fac[i - 1] * i % mod;

    inv[20000] = 292343761;

    for (int i = 20000; i >= 1; i--)

        inv[i - 1] = (long) inv[i] * i % mod;



    scanf("%s%s", a, b);

    int x = 0, y = 0;

    for (int i = 0; a[i]; i++)

        if (a[i] == '1')

            (b[i] == '0' ? x : y)++;

    printf("%d\n", solve(x, y));

}