stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

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

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

#define reps(x,c) for(auto x:c)

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

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}



int main(){

  ll n=read(),a=read(),b=read(),ans=1e9,c=a-b;

  vector<ll> h(n);

  rep(i,n){

    h[i]=read();

  }

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid;

      if(temp>0){

        cnt+=ceil(1.0*temp/c);

      }

    }

    if(cnt<mid){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right;

    if(temp>0){

      cnt+=ceil(1.0*temp/c);

    }

  }

  ans=min(ans,max(cnt,right));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left;

    if(temp>0){

      cnt+=ceil(1.0*temp/c);

    }

  }

  ans=min(ans,max(cnt,left));

  cout<<ans<<endl;

  return 0;

}

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

#include <cstdio>

using namespace std;

#define rep(i, n) for (register uint_fast32_t i = 0; i < (n); ++i)

inline char tc() {

    static char fl[100], *A = fl, *B = fl;

    return A == B && (B = (A = fl) + fread(fl, 1, 100, stdin), A == B) ? EOF

                                                                       : *A++;

}

inline uint_fast32_t read() {

    uint_fast32_t a = 0;

    static char c;

    c = tc();

    while (c & 16) a = a * 10 + c - 48, c = tc();

    return a;

}

uint_fast32_t h[100001], n, a, b, left, right;

int_fast64_t temp, cnt, mid;

double a_;

int main() {

    n = read(), a = read(), b = read();

    a -= b;

    a_             = 1.0 / a;

    rep(i, n) h[i] = read();

    left = 0, right = 1000000000;

    cnt = 0;

    while (right > left + 1) {

        mid = (right + left) >> 1;

        cnt = 0;

        rep(i, n) {

            temp = h[i] - b * mid + a - 1;

            if (temp > 0) cnt += temp * a_;

        }

        if (cnt <= mid)

            right = mid;

        else

            left = mid;

    }

    printf("%u\n", right);

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

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>

#include <numeric>

#include <set>

#include <map>

#include <stack>

#include <queue>

#include <time.h>

#include <list>

#include <bitset>



using namespace std;

typedef long long ll;

template<class T=ll> 

T in(){T x;cin>>x;return (x);}

template<class T> 

void print(T &x){cout<<x<<"\n";}

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

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

#define reps(x,c) for(auto x:c)

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

#define pb(a) emplace_back(a) 

#define mp(a,b) make_pair((a),(b))

#define pl pair<ll,ll>

#define INF 2147483600

#define MOD 1000000007

#define fi first

#define se second

#define dbg(x) cerr << #x"="<< (x) << "\n"

#define dbgv(x) cerr<<#x<<"\n";reps(y,x){cerr<<y<<" ";}cerr<<"\n"



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}



int main(){

  ll n=read(),a=read(),b=read(),ans=1e9,c=a-b;

  vector<ll> h(n);

  rep(i,n){

    h[i]=read();

  }

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid;

      if(temp>0){

        cnt+=temp/c+((temp%c)?1:0);

      }

    }

    if(cnt<mid){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right;

    if(temp>0){

      cnt+=temp/c+((temp%c)?1:0);

    }

  }

  ans=min(ans,max(cnt,right));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left;

    if(temp>0){

      cnt+=temp/c+((temp%c)?1:0);

    }

  }

  ans=min(ans,max(cnt,left));

  cout<<ans<<endl;

  return 0;

}

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

#include <cstdio>

using namespace std;

#define rep(i, n) for (register uint_fast32_t i = 0; i < (n); ++i)

inline char tc() {

    static char fl[100], *A = fl, *B = fl;

    return A == B && (B = (A = fl) + fread(fl, 1, 100, stdin), A == B) ? EOF

                                                                       : *A++;

}

inline uint_fast32_t read() {

    uint_fast32_t a = 0;

    static char c;

    c = tc();

    while (c & 16) a = a * 10 + c - 48, c = tc();

    return a;

}

uint_fast32_t h[100001], n, a, b, left, right;

int_fast64_t temp, cnt, mid;

double a_;

int main() {

    n = read(), a = read(), b = read();

    a -= b;

    a_             = 1.0 / a;

    rep(i, n) h[i] = read();

    left = 0, right = 1000000000;

    cnt = 0;

    while (right > left + 1) {

        mid = (right + left) >> 1;

        cnt = 0;

        rep(i, n) {

            temp = h[i] - b * mid + a - 1;

            if (temp > 0) cnt += temp * a_;

        }

        if (cnt <= mid)

            right = mid;

        else

            left = mid;

    }

    printf("%u\n", right);

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

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cmath>



using namespace std;

typedef long long ll;

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



inline char tc(){

  static char fl[100],*A=fl,*B=fl;

  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  

}

inline int read(){

  int a=0;static char c;

  while((c=tc())<48||c>57);

  while(c>=48&&c<=57)a=a*10+c-48,c=tc();

  return a;

}

ll h[100010];

int main(){

  ll n=read(),a=read(),b=read(),ans=1e9,c=a-b;

  rep(i,n)h[i]=read();

  ll left=1,right=1e9,mid,cnt=0;

  while (right!=left+1) {

    mid =(right+left)/2;

    cnt=0;

    rep(i,n){

      ll temp=h[i]-b*mid;

      if(temp>0){

        cnt+=ceil(1.0*temp/c);

      }

    }

    if(cnt<mid){

      right=mid;

    }else left=mid;

  }

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*right;

    if(temp){

      cnt+=ceil(1.0*temp/c);

    }

  }

  ans=min(ans,max(cnt,right));

  cnt=0;

  rep(i,n){

    ll temp=h[i]-b*left;

    if(temp>0){

      cnt+=ceil(1.0*temp/c);

    }

  }

  ans=min(ans,max(cnt,left));

  cout<<ans<<endl;

  return 0;

}

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

#include <cstdio>

using namespace std;

#define rep(i, n) for (register uint_fast32_t i = 0; i < (n); ++i)

inline char tc() {

    static char fl[100], *A = fl, *B = fl;

    return A == B && (B = (A = fl) + fread(fl, 1, 100, stdin), A == B) ? EOF

                                                                       : *A++;

}

inline uint_fast32_t read() {

    uint_fast32_t a = 0;

    static char c;

    c = tc();

    while (c & 16) a = a * 10 + c - 48, c = tc();

    return a;

}

uint_fast32_t h[100001], n, a, b, left, right;

int_fast64_t temp, cnt, mid;

double a_;

int main() {

    n = read(), a = read(), b = read();

    a -= b;

    a_             = 1.0 / a;

    rep(i, n) h[i] = read();

    left = 0, right = 1000000000;

    cnt = 0;

    while (right > left + 1) {

        mid = (right + left) >> 1;

        cnt = 0;

        rep(i, n) {

            temp = h[i] - b * mid + a - 1;

            if (temp > 0) cnt += temp * a_;

        }

        if (cnt <= mid)

            right = mid;

        else

            left = mid;

    }

    printf("%u\n", right);

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

#include <vector>

#include <algorithm>



using namespace std;



typedef long long ll;

typedef pair<ll, ll> P;



#define MOD 1000000007

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

#define REP1(i, N) for (int i = 1; i <= N; ++i)

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

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



int N;

ll A, B;

vector<ll> h(100001);



bool enough(ll t)

{

  ll add = 0;

  REP(i, N)

  {

    if (B * t < h[i])

      add += ((h[i] - B * t) + (A - B) - 1) / (A - B);

  }

  return (add <= t);

}



ll meguru()

{

  ll ng = 0, ok = 1e9;

  while (1 < abs(ok - ng))

  {

    ll mid = (ok + ng) / 2;

    if (enough(mid))

      ok = mid;

    else

      ng = mid;

  }

  return ok;

}



int main()

{

  cin >> N >> A >> B;

  REP(i, N)

  cin >> h[i];

  cout << meguru() << endl;

  return 0;

}

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

#include <iostream>

#include <vector>



using namespace std;



typedef long long ll;

typedef pair<ll, ll> P;



#define MOD 1000000007

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

#define REP1(i, N) for (int i = 1; i <= N; ++i)

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

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



int n;

ll a, b;

vector<ll> vc;



bool check(ll t) {

  ll cnt = 0;

  REP(i, n) {

    if (vc[i] > b * t) {

      cnt += (vc[i] - b * t + a - b - 1) / (a - b);

    }

  }

  return cnt <= t;

}



int main() {

  cin >> n >> a >> b;

  REP(i, n) {

    ll h;

    cin >> h;

    vc.push_back(h);

  }

  ll ok = 1e9, ng = 0;

  while (1 < abs(ok - ng)) {

    ll mid = (ok + ng) / 2;

    if (check(mid))

      ok = mid;

    else

      ng = mid;

  }

  cout << ok << endl;

  return 0;

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

#include <algorithm>

#include <math.h>

#include <string>

#include <cstdio>

#include <vector>

#include <set>

#include <cassert>

#include <cstdlib>

#include <complex>

#include <cctype>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <map>

#include <set>

#include <sstream>

#include <functional>

#include <iomanip>

//#include <windows.h>  //Should be deleted when using AtCoder&POJ

using namespace std;



#define ll long long

#define pq_small priority_queue<int,vector<int>,greater<int> >

/**==Info==

*Program:1

*Problem:Widespread

*Date:2017-10-6

*Algorithm:Binary Search+Simluate+Brute Force (TLE Possible JP)

*Stats:Unknown*/

ll n,a,b;

ll h[100005],t[100005];



bool check(ll m){

	//How to write this?

	//Evreryone minus b*m then find whether it is overflow!!!!

	ll cost=0;

	

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

		if(h[i]-b*m>0){

			cost+=(h[i]-b*m+(a-b-1))/(a-b);

		}

	}

	

	return cost<=m;

}

int main(){

	cin>>n>>a>>b;

	for(ll i=0;i<n;i++) cin>>h[i];

	

	ll l=1,r=1e9;

	while(l<=r){

		ll m=(l+r)/2;

		if(check(m)){

			r=m-1;

		}else{

			l=m+1;

		}

	}

	cout<<l<<endl;

	return 0;

}


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

int n,a,b,h[100000],i,l,m,r;

long long x;

main(){

  for(scanf("%d%d%d",&n,&a,&b),a-=b;i<n;l=1,r=1e9)scanf("%d",h+i++);

  while(l<r){

    m=(l+r)/2;

    for(x=i=0;i<n;++i)h[i]>(long long)m*b?x+=(h[i]-m*b+a-1)/a:0;

    x<=m?r=m:l=m+1;

  }

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

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

#include <string>

#include <cstdio>

#include <vector>

#include <queue>

#include <list>

#include <cstdlib>

#include <algorithm>

#include <set>

#include <map>

#include <deque>

#include <cstring>

#include <cmath>

//#include<bits/stdc++.h>

using namespace std;



const int SIZE=100005;

const long long INF=1e9;

int n,a,b,h[SIZE];



bool check(long long times){

	long long t=times;

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

		if(times*b>=(long long)h[i]);

		else if(times*a>=(long long)h[i]){

			t-=(long long)ceil((double)((double)(h[i]-times*b))/((double)(a-b)));

			if(t<0) return false;

		}

		else return false;

	}

	return true;

}



int main(){

	cin>>n>>a>>b;

	for(int i=0;i<n;i++) cin>>h[i];

	long long lb=-1,rb=INF;

	while(rb-lb>1){

		long long mid=(lb+rb)/(long long)2;

		if(check(mid)){

			rb=mid;

		}

		else{

			lb=mid;

		}

	}

	cout<<rb<<endl;

	return 0;

}


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

int n,a,b,h[100000],i,l,m,r;

long long x;

main(){

  for(scanf("%d%d%d",&n,&a,&b),a-=b;i<n;l=1,r=1e9)scanf("%d",h+i++);

  while(l<r){

    m=(l+r)/2;

    for(x=i=0;i<n;++i)h[i]>(long long)m*b?x+=(h[i]-m*b+a-1)/a:0;

    x<=m?r=m:l=m+1;

  }

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

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

 

using namespace std;

 

int h[111111];

int n, a, b;

 

bool ok(int t){

	long long q = 0;

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

		if (1ll * a * t < h[i]) return false;

		long long x = h[i] - 1ll * b * t;

		if (x > 0) q += (x - 1) / (a - b) + 1;

		if (q > t) return false; 

	}

	return true;

}

 

int main(){

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

	for(int i = 1; i <= n; ++i) scanf("%d",&h[i]);

	int l = 1, r = 1e9;

	while (l <= r){

		int md = (l + r) >> 1;

		if (ok(md)) r = md - 1;

		else l = md + 1;

	}

	printf("%d",l);

	return 0;

}

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

int n,a,b,h[100000],i,l,m,r;

long long x;

main(){

  for(scanf("%d%d%d",&n,&a,&b),a-=b;i<n;l=1,r=1e9)scanf("%d",h+i++);

  while(l<r){

    m=(l+r)/2;

    for(x=i=0;i<n;++i)h[i]>(long long)m*b?x+=(h[i]-m*b+a-1)/a:0;

    x<=m?r=m:l=m+1;

  }

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

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



#define endl '\n'



using namespace std;



int main() {

  ios_base::sync_with_stdio(false);

  cin.tie(0);



  int p, q, r;

  cin >> p >> q >> r;

  cout << min(p + q, min(p + r, r + q)) << endl;



  return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

    int a[5];

    scanf("%d %d %d",&a[1],&a[2],&a[3]);

    sort(a+1,a+4);

    printf("%d\n",a[1]+a[2]);

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



using namespace std;



int main()

{



    int p=0;

    int q=0;

    int r=0;

    int v=0;

    int b=0;

    int m=0;

    int l=0;

    cin>>p;

    cin>>q;

    cin>>r;

    if((p==q)&&(p==r)){

    l=p+q;

    goto me;

}

else if(((p==q)&&(p!=r))&&p>r){



    l=p+r;

    goto me;

}

else if(((p==q)&&(p!=r))&&p<r){

    l=p+q;

    goto me;

}

else if(((p==r)&&(p!=q))&&p>q){

    l=p+q;

    goto me;

}

else if(((p==r)&&(p!=q))&&p<q){

    l=p+r;

    goto me;

}

else if(((r==q)&&(r!=p))&&r>p){

l=p+r;

    goto me;

}

else if(((r==q)&&(r!=p))&&r<p){

   l=r+q;

    goto me;

    }







        else if(p<q&&p<r){

            m=p;

         }



         else if(q<p&&q<r){

            m=q;

         }



          else if(r<p&&r<q){

            m=r;

         }

        if((p<q&&p>r)||(p<r&&p>q)){



            b=p;

         }

         else if((q<p&&q>r) || (q<r&&q>p)){

            b=q;

         }

         else if((r<q&&r>p) || (r<p&&r>q)){

            b=r;

         }







l=m+b;

me:

cout << l;

    return 0;

}


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

#include<algorithm>

using namespace std;

int main()

{

    int a[5];

    scanf("%d %d %d",&a[1],&a[2],&a[3]);

    sort(a+1,a+4);

    printf("%d\n",a[1]+a[2]);

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



#define endl '\n'



using namespace std;



int main() {

  ios_base::sync_with_stdio(false);

  cin.tie(0);



  int p, q, r;

  cin >> p >> q >> r;

  cout << min(p + q, min(p + r, r + q)) << endl;



  return 0;

}


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

int d[100];

int main(){

int a,b,c,e;

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

d[1]=a+b;

d[2]=a+c;

d[3]=b+c;

e=d[1];

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

    if(e>d[i])e=d[i];

}

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



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



using namespace std;



int main()

{



    int p=0;

    int q=0;

    int r=0;

    int v=0;

    int b=0;

    int m=0;

    int l=0;

    cin>>p;

    cin>>q;

    cin>>r;

    if((p==q)&&(p==r)){

    l=p+q;

    goto me;

}

else if(((p==q)&&(p!=r))&&p>r){



    l=p+r;

    goto me;

}

else if(((p==q)&&(p!=r))&&p<r){

    l=p+q;

    goto me;

}

else if(((p==r)&&(p!=q))&&p>q){

    l=p+q;

    goto me;

}

else if(((p==r)&&(p!=q))&&p<q){

    l=p+r;

    goto me;

}

else if(((r==q)&&(r!=p))&&r>p){

l=p+r;

    goto me;

}

else if(((r==q)&&(r!=p))&&r<p){

   l=r+q;

    goto me;

    }







        else if(p<q&&p<r){

            m=p;

         }



         else if(q<p&&q<r){

            m=q;

         }



          else if(r<p&&r<q){

            m=r;

         }

        if((p<q&&p>r)||(p<r&&p>q)){



            b=p;

         }

         else if((q<p&&q>r) || (q<r&&q>p)){

            b=q;

         }

         else if((r<q&&r>p) || (r<p&&r>q)){

            b=r;

         }







l=m+b;

me:

cout << l;

    return 0;

}


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

int d[100];

int main(){

int a,b,c,e;

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

d[1]=a+b;

d[2]=a+c;

d[3]=b+c;

e=d[1];

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

    if(e>d[i])e=d[i];

}

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



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

#include<math.h>

#include<bits/stdc++.h>

#include<string.h>

#include<algorithm>

using namespace std;

int a[5];

int main()

{

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

        scanf("%d",&a[i]);

    sort(a+1,a+4);

    printf("%d\n",a[1]+a[2]);

    return 0;

}


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

int d[100];

int main(){

int a,b,c,e;

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

d[1]=a+b;

d[2]=a+c;

d[3]=b+c;

e=d[1];

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

    if(e>d[i])e=d[i];

}

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



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



#define endl '\n'



using namespace std;



int main() {

  ios_base::sync_with_stdio(false);

  cin.tie(0);



  int p, q, r;

  cin >> p >> q >> r;

  cout << min(p + q, min(p + r, r + q)) << endl;



  return 0;

}


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

#include <string.h>

#include<algorithm>

using namespace std;

int main()

{

    int p,q,r;

    scanf("%d%d%d",&p,&q,&r);

    int a=q+p;

    int b=q+r;

    int c=p+r;

    if(a>b)

    {

        a=b;

    }

    if(a>c)

    {

        a=c;

    }

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

    return 0;

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



using namespace std;



int main()

{



    int p=0;

    int q=0;

    int r=0;

    int v=0;

    int b=0;

    int m=0;

    int l=0;

    cin>>p;

    cin>>q;

    cin>>r;

    if((p==q)&&(p==r)){

    l=p+q;

    goto me;

}

else if(((p==q)&&(p!=r))&&p>r){



    l=p+r;

    goto me;

}

else if(((p==q)&&(p!=r))&&p<r){

    l=p+q;

    goto me;

}

else if(((p==r)&&(p!=q))&&p>q){

    l=p+q;

    goto me;

}

else if(((p==r)&&(p!=q))&&p<q){

    l=p+r;

    goto me;

}

else if(((r==q)&&(r!=p))&&r>p){

l=p+r;

    goto me;

}

else if(((r==q)&&(r!=p))&&r<p){

   l=r+q;

    goto me;

    }







        else if(p<q&&p<r){

            m=p;

         }



         else if(q<p&&q<r){

            m=q;

         }



          else if(r<p&&r<q){

            m=r;

         }

        if((p<q&&p>r)||(p<r&&p>q)){



            b=p;

         }

         else if((q<p&&q>r) || (q<r&&q>p)){

            b=q;

         }

         else if((r<q&&r>p) || (r<p&&r>q)){

            b=r;

         }







l=m+b;

me:

cout << l;

    return 0;

}


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

#include <string.h>

#include<algorithm>

using namespace std;

int main()

{

    int p,q,r;

    scanf("%d%d%d",&p,&q,&r);

    int a=q+p;

    int b=q+r;

    int c=p+r;

    if(a>b)

    {

        a=b;

    }

    if(a>c)

    {

        a=c;

    }

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

    return 0;

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

#include<math.h>

#include<bits/stdc++.h>

#include<string.h>

#include<algorithm>

using namespace std;

int a[5];

int main()

{

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

        scanf("%d",&a[i]);

    sort(a+1,a+4);

    printf("%d\n",a[1]+a[2]);

    return 0;

}


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

#include <string.h>

#include<algorithm>

using namespace std;

int main()

{

    int p,q,r;

    scanf("%d%d%d",&p,&q,&r);

    int a=q+p;

    int b=q+r;

    int c=p+r;

    if(a>b)

    {

        a=b;

    }

    if(a>c)

    {

        a=c;

    }

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

    return 0;

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



#define endl '\n'



using namespace std;



int main() {

  ios_base::sync_with_stdio(false);

  cin.tie(0);



  int p, q, r;

  cin >> p >> q >> r;

  cout << min(p + q, min(p + r, r + q)) << endl;



  return 0;

}


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

#include<algorithm>

using namespace std;

int air[5];

int main()

{

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

        scanf("%d",&air[i]);

    sort(air,air+3);

    printf("%d\n",air[0]+air[1]);

    return 0;

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



using namespace std;



int main()

{



    int p=0;

    int q=0;

    int r=0;

    int v=0;

    int b=0;

    int m=0;

    int l=0;

    cin>>p;

    cin>>q;

    cin>>r;

    if((p==q)&&(p==r)){

    l=p+q;

    goto me;

}

else if(((p==q)&&(p!=r))&&p>r){



    l=p+r;

    goto me;

}

else if(((p==q)&&(p!=r))&&p<r){

    l=p+q;

    goto me;

}

else if(((p==r)&&(p!=q))&&p>q){

    l=p+q;

    goto me;

}

else if(((p==r)&&(p!=q))&&p<q){

    l=p+r;

    goto me;

}

else if(((r==q)&&(r!=p))&&r>p){

l=p+r;

    goto me;

}

else if(((r==q)&&(r!=p))&&r<p){

   l=r+q;

    goto me;

    }







        else if(p<q&&p<r){

            m=p;

         }



         else if(q<p&&q<r){

            m=q;

         }



          else if(r<p&&r<q){

            m=r;

         }

        if((p<q&&p>r)||(p<r&&p>q)){



            b=p;

         }

         else if((q<p&&q>r) || (q<r&&q>p)){

            b=q;

         }

         else if((r<q&&r>p) || (r<p&&r>q)){

            b=r;

         }







l=m+b;

me:

cout << l;

    return 0;

}


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

#include<algorithm>

using namespace std;

int air[5];

int main()

{

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

        scanf("%d",&air[i]);

    sort(air,air+3);

    printf("%d\n",air[0]+air[1]);

    return 0;

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

#include<math.h>

#include<bits/stdc++.h>

#include<string.h>

#include<algorithm>

using namespace std;

int a[5];

int main()

{

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

        scanf("%d",&a[i]);

    sort(a+1,a+4);

    printf("%d\n",a[1]+a[2]);

    return 0;

}


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

#include<algorithm>

using namespace std;

int air[5];

int main()

{

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

        scanf("%d",&air[i]);

    sort(air,air+3);

    printf("%d\n",air[0]+air[1]);

    return 0;

}