#include #include #include using namespace std; const int MAXRF = 200; const int MAXS = 600; const int MAXT = 1000; string names[MAXS]; int nnames; bool addName(string s) { for(int i=0; i> s >> r >> f >> t; if (r < 1 || r > MAXRF) { cout << "ERROR: incorrect r: " << r << endl; return 1; } if (f < 1 || f > MAXRF) { cout << "ERROR: incorrect f: " << f << endl; return 2; } if (s < r+f || s > MAXS) { cout << "ERROR: incorrect s: " << s << endl; return 3; } if (t < 1 || t > MAXT) { cout << "ERROR: incorrect t: " << t << endl; return 4; } nnames=0; for(int i=0; i> str[i]; if (!addName(str[i])) { cout << "ERROR: repeated raw material state: " << str[i] << endl; return 5; } } for(int i=0; i> str[i]; if (!addName(str[i])) { cout << "ERROR: repeated factory state: " << str[i] << endl; return 6; } } for(int i=0; i> n; if (n < 1 || n > s) { cout << "ERROR: incorrect n: " << n << " on line " << t << endl; return 7; } for(int j=0; j> str[j]; addName(str[j]); for(int k=0; k