Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int u32;
typedef pair<int, int> p;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int Inf = (1<<30);
ll inf = (1LL<<60);
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main(){ // めっちゃ難しく考えてた
	int a, b;
	cin >> a >> b;
	int c, d;
	cin >> c >> d;
	int e;
	cin >> e;
	int f;
	cin >> f;
	int i, j, k, l;
	vector<int> water(901, 0);
	int ans1 = 1000000;
	int ans2 = 1;
	for (i = 0; 100 * i * a <= f; i++) {
		int A = 100 * i * a;
		for (j = 0; 100 * j * b <= f - A; j++) {
			int B = 100 * j * b;
			for (k = 0; k <= f - A - B; k++) {
				int C = k * c;
				for (l = 0; l <= f - A - B - C; l++) {
					int W = A + B;
					if (W > f) continue;
					int S = C + l * d;
					if (W + S > f || W / 100 * e < S) continue;
					double ans = (double)ans2 / double(ans1);
					double tmp = (double)S / (double)(W + S);
					if (ans < tmp) {
						ans1 = W + S;
						ans2 = S;
					}
				}
			}
		}
	}
	cout << ans1 << " " << ans2;
	return(0);
}#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int u32;
typedef pair<int, int> p;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int Inf = (1<<30);
ll inf = (1LL<<60);
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main(){ // めっちゃ難しく考えてた
	int a, b;
	cin >> a >> b;
	int c, d;
	cin >> c >> d;
	int e;
	cin >> e;
	int f;
	cin >> f;
	int i, j, k, l;
	int ans1 = 1000000;
	int ans2 = 1;
	for (i = 0; 100 * i * a <= f; i++) {
		int A = 100 * i * a;
		for (j = 0; 100 * j * b <= f - A; j++) {
			int B = 100 * j * b;
			for (k = 0; k <= f - A - B; k++) {
				int C = k * c;
				for (l = 0; l <= f - A - B - C; l++) {
					int W = A + B;
					if (W > f) continue;
					int S = C + l * d;
					if (W + S > f || W / 100 * e < S) continue;
					double ans = (double)ans2 / double(ans1);
					double tmp = (double)S / (double)(W + S);
					if (ans < tmp) {
						ans1 = W + S;
						ans2 = S;
					}
				}
			}
		}
	}
	cout << ans1 << " " << ans2;
	return(0);
}

Compiler output:
a.cc:48:2: error: stray '#' in program
   48 | }#include<bits/stdc++.h>
      |  ^
a.cc:48:3: error: 'include' does not name a type
   48 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:53:31: error: redefinition of 'template<class T> bool chmin(T&, T)'
   53 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:6:31: note: 'template<class T> bool chmin(T&, T)' previously declared here
    6 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:54:31: error: redefinition of 'template<class T> bool chmax(T&, T)'
   54 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:7:31: note: 'template<class T> bool chmax(T&, T)' previously declared here
    7 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:55:5: error: redefinition of 'int Inf'
   55 | int Inf = (1<<30);
      |     ^~~
a.cc:8:5: note: 'int Inf' previously defined here
    8 | int Inf = (1<<30);
      |     ^~~
a.cc:56:4: error: redefinition of 'll inf'
   56 | ll inf = (1LL<<60);
      |    ^~~
a.cc:9:4: note: 'll inf' previously defined here
    9 | ll inf = (1LL<<60);
      |    ^~~
a.cc:57:4: error: redefinition of 'll gcd(ll, ll)'
   57 | ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
      |    ^~~
a.cc:10:4: note: 'll gcd(ll, ll)' previously defined here
   10 | ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
      |    ^~~
a.cc:58:4: error: redefinition of 'll lcm(ll, ll)'
   58 | ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
      |    ^~~
a.cc:11:4: note: 'll lcm(ll, ll)' previously defined here
   11 | ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
      |    ^~~
a.cc:59:5: error: redefinition of 'int main()'
   59 | int main(){ // めっちゃ難しく考えてた
      |     ^~~~
a.cc:12:5: note: 'int main()' previously defined here
   12 | int main(){ // めっちゃ難しく考えてた
      |     ^~~~