harmonics arb
harmonics arb
#include <iostream>
#include <vector>
#include <stack>
#include <climits>
#include <cctype>
using namespace std;
pair<int, int> ev(const string& exp, bool optimized, int a, int b, int c, int d) {
stack<int> s; // Stack to store numbers
stack<int> cs; // Stack to store operation costs
if (i == '+') {
s.push(n1 + n2);
cs.push(c1 + c2 + a);
} else if (i == '-') {
s.push(n1 - n2);
cs.push(c1 + c2 + b);
} else if (i == '*') {
s.push(n1 * n2);
cs.push(c1 + c2 + c);
} else if (i == '/') {
s.push(n1 / n2); // Assuming integer division
cs.push(c1 + c2 + d);
}
}
}
return {s.top(), cs.top()}; // Return the result and the total cost
}
void solve() {
string exp;
cin >> exp; // Read the expression
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e; // Read the costs for operations
cout << mn << " " << res << endl; // Print the minimum cost and result
}
int main() {
solve(); // Call the solve function
return 0;
}