#include <cmath>
#include <iostream>
using namespace std;
int main() {
double x, a, s;
cin >> x >> a;
if (x > 1) {
s = a * log(x) + pow(x,1/3);
}
if (x == 1) {
s = 0;
if (x <= 1) {
s = 2 * a * cos(x) + 3 * pow(x, 2);
cout << s;
return 0;
#include <cmath>
#include <iostream>
using namespace std;
int main() {
double x, a, s;
cin >> x >> a;
if (x > 1) {
s = a * log(x) + pow(x,1/3);
}
if (x == 1) {
s = 0;
}
if (x <= 1) {
s = 2 * a * cos(x) + 3 * pow(x, 2);
}
cout << s;
return 0;
}