#include <iostream>
using namespace std;
int main() {
int type_class;
double weight, cost;
cin >> type_class >> weight;
// Class: Economy 0; Business 2; VIP 3
switch (type_class) {
case 1:
if (weight <= 25) {
cout << "0";
} else if (weight > 40) {
cost = 2.00 * (weight - 40);
cout << cost;
} else {
cost = 1.50 * (weight - 25);
cout << cost;
}
break;
case 2:
if (weight <= 35) {
cout << "0";
} else if (weight > 50) {
cost = 1.50 * (weight - 50);
cout << cost;
} else {
cost = 1.25 * (weight - 35);
cout << cost;
}
break;
case 3:
if (weight <= 60) {
cout << "0";
} else {
cout << "30";
}
break;
default:
cout << "Wrong Input" << endl;
break;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgdHlwZV9jbGFzczsKICAgIGRvdWJsZSB3ZWlnaHQsIGNvc3Q7CiAgICBjaW4gPj4gdHlwZV9jbGFzcyA+PiB3ZWlnaHQ7CgogICAgLy8gQ2xhc3M6IEVjb25vbXkgMDsgQnVzaW5lc3MgMjsgVklQIDMKCiAgICBzd2l0Y2ggKHR5cGVfY2xhc3MpIHsKICAgICAgICBjYXNlIDE6CiAgICAgICAgICAgIGlmICh3ZWlnaHQgPD0gMjUpIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgIjAiOwogICAgICAgICAgICB9IGVsc2UgaWYgKHdlaWdodCA+IDQwKSB7CiAgICAgICAgICAgICAgICBjb3N0ID0gMi4wMCAqICh3ZWlnaHQgLSA0MCk7CiAgICAgICAgICAgICAgICBjb3V0IDw8IGNvc3Q7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBjb3N0ID0gMS41MCAqICh3ZWlnaHQgLSAyNSk7CiAgICAgICAgICAgICAgICBjb3V0IDw8IGNvc3Q7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAyOgogICAgICAgICAgICBpZiAod2VpZ2h0IDw9IDM1KSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICIwIjsKICAgICAgICAgICAgfSBlbHNlIGlmICh3ZWlnaHQgPiA1MCkgewogICAgICAgICAgICAgICAgY29zdCA9IDEuNTAgKiAod2VpZ2h0IC0gNTApOwogICAgICAgICAgICAgICAgY291dCA8PCBjb3N0OwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgY29zdCA9IDEuMjUgKiAod2VpZ2h0IC0gMzUpOwogICAgICAgICAgICAgICAgY291dCA8PCBjb3N0OwogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgMzoKICAgICAgICAgICAgaWYgKHdlaWdodCA8PSA2MCkgewogICAgICAgICAgICAgICAgY291dCA8PCAiMCI7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICIzMCI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgY291dCA8PCAiV3JvbmcgSW5wdXQiIDw8IGVuZGw7CiAgICAgICAgICAgIGJyZWFrOwogICAgfQoKICAgIHJldHVybiAwOwp9Cg==