Language: C++

#include <vector> 
#include <list> 
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x*x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << '=' << (x) << endl;
#define debug(x) cerr << #x << '=' << (x) << '(L' << __LINE__ << ')' << ' ' << __FILE__ << endl;
int xlist[10000], ylist[10000];
int main() {
	//1 2 1 2 100 1000
	//100g 200g 1g 2g 100g/100 1000 size 
	int water1, water2, suger1, suger2, maxsuger100, boxsize, a;
	cin >> a;
	water1 = a * 100;
	cin >> a;
	water2 = a * 100;
	cin >> suger1;
	cin >> suger2;
	cin >> maxsuger100;
	cin >> boxsize;


	int indexx = 0;
	for (int x = 1; x<boxsize; x++) {

		for (int i = 0; i<(boxsize / water1 + 1); i++) {
			if ((x - water1*i) % water2 == 0) {
				xlist[indexx++] = x;
				goto NEXTX;
			}
		}
	NEXTX:;
	}
 


	int indexy = 0;
	for (int y = 1; y<boxsize; y++) {

		for (int i = 0; i<(boxsize / suger1 + 1); i++) {
			if ((y - suger1*i) % suger2 == 0) {
				//cerr << i << " " <<y<< endl;
				ylist[indexy++] = y;
				goto NEXTY;
			}
		}
	NEXTY:;
	}
  

	float maxnoudo = 0.0, noudo;
	int bestx=0, besty=0;

	REP(i, indexx) REP(j, indexy) {

		int x_ = xlist[i];
		int y_ = ylist[j];
		float scale = (float)x_ / 100.0;
        if ((float)y_>(float)maxsuger100*scale) { continue; }
        if(x_+y_>boxsize){continue;}
        noudo = 100 * (float)y_ / ((float)x_ + (float)y_);
        if(noudo==nan){continue;}
        //cerr<<noudo<<endl;
		if (noudo>maxnoudo) {
			maxnoudo = noudo;
			bestx = x_; besty = y_;
		}


	}

	cout << bestx+besty << " " << besty << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:123:17: error: invalid operands of types 'float' and 'double(const char*) noexcept' to binary 'operator=='
  123 |         if(noudo==nan){continue;}
      |            ~~~~~^~~~~
      |            |      |
      |            float  double(const char*) noexcept