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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


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





int main(){

    int a;

    scanf("%d", &a);



    int sum = a;

    int temp = a;

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

        temp *= a;

        sum += temp;

    }



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





    return 0;

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

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





int main(){

    int a;

    scanf("%d", &a);



    int sum = a;

    int temp = a;

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

        temp *= a;

        sum += temp;

    }



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





    return 0;

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

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





int main(){

    int a;

    scanf("%d", &a);



    int sum = a;

    int temp = a;

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

        temp *= a;

        sum += temp;

    }



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





    return 0;

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

using namespace std;

int main(void)

{

    short int a;

    cin>>a;



    int ans = a + pow(a,2) + pow(a,3);

    cout<<ans<<endl;

}

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



int main(){

	int i;

	scanf("%d" ,&i);

	printf("%d\n" ,i + i*i + i*i*i);

	return 0;

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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


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



int main(){

	int i;

	scanf("%d" ,&i);

	printf("%d\n" ,i + i*i + i*i*i);

	return 0;

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

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



int main(){

	int i;

	scanf("%d" ,&i);

	printf("%d\n" ,i + i*i + i*i*i);

	return 0;

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

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



int main(){

	int i;

	scanf("%d" ,&i);

	printf("%d\n" ,i + i*i + i*i*i);

	return 0;

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

using namespace std;

int main(void)

{

    short int a;

    cin>>a;



    int ans = a + pow(a,2) + pow(a,3);

    cout<<ans<<endl;

}

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



int main(){

	int a;

	scanf("%d", &a);

	a= a+a*a+a*a*a;

	printf("%d", a);

	return 0;

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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


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



int main(){

	int a;

	scanf("%d", &a);

	a= a+a*a+a*a*a;

	printf("%d", a);

	return 0;

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

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



int main(){

	int a;

	scanf("%d", &a);

	a= a+a*a+a*a*a;

	printf("%d", a);

	return 0;

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

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



int main(){

	int a;

	scanf("%d", &a);

	a= a+a*a+a*a*a;

	printf("%d", a);

	return 0;

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

using namespace std;

int main(void)

{

    short int a;

    cin>>a;



    int ans = a + pow(a,2) + pow(a,3);

    cout<<ans<<endl;

}

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

int main(){

	int a, b, c;

	scanf("%d", &a);

	b= a*a;

	c= a*a*a;

	printf("%d", a+b+c);

	

	return 0;

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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


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

int main(){

	int a, b, c;

	scanf("%d", &a);

	b= a*a;

	c= a*a*a;

	printf("%d", a+b+c);

	

	return 0;

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

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

int main(){

	int a, b, c;

	scanf("%d", &a);

	b= a*a;

	c= a*a*a;

	printf("%d", a+b+c);

	

	return 0;

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

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

int main(){

	int a, b, c;

	scanf("%d", &a);

	b= a*a;

	c= a*a*a;

	printf("%d", a+b+c);

	

	return 0;

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

using namespace std;

int main(void)

{

    short int a;

    cin>>a;



    int ans = a + pow(a,2) + pow(a,3);

    cout<<ans<<endl;

}

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



int main()



{

    long long int a;

    scanf("%lld", &a);

    printf("%lld", a + (a * a) + (a * a * a));



    return 0;

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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


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



int main()



{

    long long int a;

    scanf("%lld", &a);

    printf("%lld", a + (a * a) + (a * a * a));



    return 0;

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

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



int main()



{

    long long int a;

    scanf("%lld", &a);

    printf("%lld", a + (a * a) + (a * a * a));



    return 0;

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

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



int main()



{

    long long int a;

    scanf("%lld", &a);

    printf("%lld", a + (a * a) + (a * a * a));



    return 0;

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

using namespace std;

int main(void)

{

    short int a;

    cin>>a;



    int ans = a + pow(a,2) + pow(a,3);

    cout<<ans<<endl;

}

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



int main(){

	int a, b, c, total;

	scanf("%d", &a);

	b= a*a;

	c= a*a*a;

	total= a+b+c;

	printf("%d", total);

	return 0;

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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


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



int main(){

	int a, b, c, total;

	scanf("%d", &a);

	b= a*a;

	c= a*a*a;

	total= a+b+c;

	printf("%d", total);

	return 0;

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

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



int main(){

	int a, b, c, total;

	scanf("%d", &a);

	b= a*a;

	c= a*a*a;

	total= a+b+c;

	printf("%d", total);

	return 0;

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

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



int main(){

	int a, b, c, total;

	scanf("%d", &a);

	b= a*a;

	c= a*a*a;

	total= a+b+c;

	printf("%d", total);

	return 0;

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

using namespace std;

int main(void)

{

    short int a;

    cin>>a;



    int ans = a + pow(a,2) + pow(a,3);

    cout<<ans<<endl;

}

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

int main (){

	int a;

	scanf("%d",&a);

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

	

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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


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

int main (){

	int a;

	scanf("%d",&a);

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

	

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

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

int main (){

	int a;

	scanf("%d",&a);

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

	

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

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

int main (){

	int a;

	scanf("%d",&a);

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

	

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

using namespace std;

int main(void)

{

    short int a;

    cin>>a;



    int ans = a + pow(a,2) + pow(a,3);

    cout<<ans<<endl;

}

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

#include <string.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum = 0;

	sum = a + a * a + a * a * a;

	printf("%d", sum);

	

	

	return 0;

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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


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

#include <string.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum = 0;

	sum = a + a * a + a * a * a;

	printf("%d", sum);

	

	

	return 0;

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

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

#include <string.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum = 0;

	sum = a + a * a + a * a * a;

	printf("%d", sum);

	

	

	return 0;

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

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

#include <string.h>



int main(){

	int a;

	scanf("%d", &a);

	

	int sum = 0;

	sum = a + a * a + a * a * a;

	printf("%d", sum);

	

	

	return 0;

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

using namespace std;

int main(void)

{

    short int a;

    cin>>a;



    int ans = a + pow(a,2) + pow(a,3);

    cout<<ans<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.276894486429885x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

using namespace std;



int main()

{

    int a;

    long int sum;

    cin>>a;

    sum=a+a*a+a*a*a;

    cout<<sum<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.268590677716335x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

using namespace std;

int main()

{

	long long a;

	cin >> a;

	cout << a + a * a + a * a * a << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.268169538217955x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

using namespace std;



int a;



int main() {

    cin >> a;

    cout << a+a*a+a*a*a << endl;

}



// hai

// Faster C++ solution for the same problem (measured speedup: 5.271425258925309x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

using namespace std;



int main()

{

	int x;

	cin>>x;

	int ans= x+(x*x)+(x*x*x);

	cout<<ans;

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.262155592274345x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

#include<cmath>

using namespace std;

int main()

{

    int a,val;

    cin>>a;

    val=a+pow(a,2)+pow(a,3);

    cout<<val;



}


// Faster C++ solution for the same problem (measured speedup: 5.270930671025484x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

using namespace std;



int main()

{

  int a;

  cin>>a;

  cout<<a+a*a+a*a*a;

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.262155592274345x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

#define ll long long

#define pb push_back

#define mp make_pair

#define vi vector <int>

#define vii vector <int>::iterator 

#define vd vector <double>

#define vdd vector <double>::iterator

#define vs vector <string>

#define vss vector <string>::iterator

#define vc vector <char>

#define vcc vector <char>::iterator

#define maxx(a,b,c) max(a,max(b,c))

#define minn(a,b,c) min(a,min(b,c))

#define SORT(x)     sort(x.begin(),x.end())

#define fill(x,y)   memset(x, y, sizeof(x))

#define PI 2*acos(0.0)

#define fio ios::sync_with_stdio(false);cin.tie(0)

using namespace std;

int main(){

   ll a;

   cin >> a;

   cout << a*(1+(a*(a+1))) << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.268171214010265x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

int main(){

    int a;

    std::cin >> a;

    a=a+a*a+a*a*a;

    std::cout << a << std::endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.271640247323456x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

}
// Slower C++ solution:


                                 /*Bismillahir Rahmanir Rahim*/





#include<bits/stdc++.h>

#include<cstring>

#include<vector>

#include<map>

#include<set>

#define ll long long int

#define dd double

using namespace std;



int main()

{

    ll t;

    cin>>t;

    ll ans=t+pow(t,2)+pow(t,3);

    cout<<ans<<endl;



}

//Apna Time Aayega :)

// Faster C++ solution for the same problem (measured speedup: 5.2745529605585375x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

#include<algorithm>

#include<cstring>

#include<cmath>

using namespace std;

int main()

{

      int a,b;

     cin>>a;

     b=a+a*a+a*a*a;

     cout<<b<<endl;

     return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.271705875360784x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

using namespace std;



int main()

{

    long long a,s;

    cin>>a;

    s=a+a*a+a*a*a;

    cout<<s<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.268169538217955x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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



using namespace std;



#define TC ll t; cin >> t; while(t--)

typedef long long ll;



int main()

{

    //freopen("input.txt", "r", stdin);

    //freopen("output.txt", "w", stdout);

    ll a; cin >> a;

    cout << (a)+(a*a)+(a*a*a) << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.268169538217955x):
///a. calc

#include <stdio.h>

int main()

{

    long long int a;

    scanf("%lld",&a);

    printf("%lld",a+a*a+a*a*a);



    return 0;

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

#include <iomanip>

#include <cmath>

#include <vector>

#include <queue>

#include <limits>

#include <algorithm>

#include <set>

#include <string>

using namespace std;



static int32_t A, B, C, D;

static vector<vector<double>> memo;



static double get_concentration(int32_t water, int32_t sugar)

{

	return water + sugar == 0 ? 0.0 : sugar / (water * 100.0 + sugar);

}



static double dp(int32_t water, int32_t sugar)

{

	if (memo[water][sugar] >= 0.0)

		return memo[water][sugar];



	double res = get_concentration(water, sugar);

	res = max(res, dp(water + A, sugar));

	res = max(res, dp(water + B, sugar));

	res = max(res, dp(water, sugar + C));

	res = max(res, dp(water, sugar + D));

	memo[water][sugar] = res;

	return memo[water][sugar];

}



int main()

{

	int32_t E, F;

	cin >> A >> B >> C >> D >> E >> F;



	memo.resize(F + 1);

	for (int32_t i = 0; i < F + 1; i++) {

		memo[i].resize(F + 1);

		fill(begin(memo[i]), end(memo[i]), -1.0);

	}

	for (int32_t water = 0; water < F + 1; water++) {

		for (int32_t sugar = 0; sugar < F + 1; sugar++) {

			if (water * 100 + sugar > F || water * E < sugar)

				memo[water][sugar] = 0.0;

		}

	}



	double _max = dp(0, 0);

	for (int32_t water = 0; water < F + 1; water++) {

		for (int32_t sugar = 0; sugar < F + 1; sugar++) {

			if (memo[water][sugar] == _max && get_concentration(water, sugar) == _max) {

				if (water == 0 && sugar == 0)

					water = A;

				cout << (water * 100 + sugar) << " " << sugar << endl;

				return 0;

			}

		}

	}



	return 0;

}

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

#include <iomanip>

#include <cmath>

#include <vector>

#include <queue>

#include <limits>

#include <algorithm>

#include <set>

#include <string>

using namespace std;



static double get_concentration(int32_t water, int32_t sugar)

{

	return water + sugar == 0 ? 0.0 : 1.0 * sugar / (water + sugar);

}



int main()

{

	int32_t A, B, C, D, E, F;

	cin >> A >> B >> C >> D >> E >> F;



	double _max = 0.0;

	int32_t max_total = 0, max_sugar = 0;

	for (int32_t a = 0; a <= F; a += 100 * A) {

		for (int32_t b = 0; a + b <= F; b += 100 * B) {

			for (int32_t c = 0; a + b + c <= F; c += C) {

				for (int32_t d = 0; a + b + c + d <= F; d += D) {

					if ((a + b) / 100 * E < c + d)

						continue;

					double concentration = get_concentration(a + b, c + d);

					if (_max < concentration) {

						_max = concentration;

						max_total = a + b + c + d;

						max_sugar = c + d;

					}

				}

			}

		}

	}

	if (max_sugar == 0)

		max_total = 100 * A;



	cout << max_total << " " << max_sugar << endl;



	return 0;

}
// Slower C++ solution:


// C - Sugar Water



#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

// const int INF = 2147483647;

// const ll INF = 9223372036854775807;

// const ll MOD = 1e9 + 7;



const int MAX = 4000;

bool dp[MAX][MAX]; // dp[a][b]: 水i(g), 砂糖j(g)の組み合わせがあれば1



int main() {

	int A, B, C, D, E, F;

	cin >> A >> B >> C >> D >> E >> F;



	dp[0][0] = 1;



	for (int a=0; a<=F; a++) {

		for (int b=0; b<=F; b++) {

			if (dp[a][b] == 0) continue;



			if (a + 100*A + b <= F) {

				dp[a + 100*A][b] = 1;

			}



			if (a + 100*B + b <= F) {

				dp[a + 100*B][b] = 1;

			}



			if ((b + C) * (100 + E) <= E * (a + (b + C)) && a + (b + C) <= F) {

				dp[a][b+C] = 1;

			}



			if ((b + D) * (100 + E) <= E * (a + (b + D)) && a + (b + D) <= F) {

				dp[a][b+D] = 1;

			}

		}

	}



	int w = 100*A, s = 0;

	for (int a=0; a<=F; a++) {

		for (int b=0; b<=F; b++) {

			if (dp[a][b] == 0) continue;



			if (b * (w + s) > s * (a + b)) {

				w = a;

				s = b;

			}

		}

	}



	cout << w + s << " " << s << endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.7985038399338344x):


// C - Sugar Water



#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//const int INF = 2147483647;

// const ll INF = 9223372036854775807;

// const ll MOD = 1e9 + 7;



const int MAX = 4000;

bool dp[MAX][MAX]; // dp[a][b]: 水i(g), 砂糖j(g)の組み合わせがあれば1



int main() {

	int A, B, C, D, E, F;

	cin >> A >> B >> C >> D >> E >> F;



	set<int> water;

	set<int> sugar;



	for (int i=0; i*100*A<=F; i++) {

		for (int j=0; j*100*B<=F; j++) {

			if ((i*100*A + j*100*B != 0) && (i*100*A + j*100*B <= F)) {

				water.insert(i*100*A + j*100*B);

			}

		}

	}



	for (int i=0; i*C<=F; i++) {

		for (int j=0; j*D<=F; j++) {

			if (i*C + j*D <= F) {

				sugar.insert(i*C + j*D);

			}

		}

	}



	int ans_w = 100*A;

	int ans_s = 0;

	for (int w : water) {

		for (int s : sugar) {

			if (s * (100 + E) > E * (w + s)) continue;

			if (w + s > F) continue;



			if (s * (ans_w + ans_s) > ans_s * (w + s)) {

				ans_w = w;

				ans_s = s;

			}

		}

	}



	cout << ans_w + ans_s << " " << ans_s << endl;



	return 0;

}