#include #include #include #include #include using namespace std; char s[20000]; double t[5][10]; double rate[] = {10, 15, 25, 28, 33, 35, 39.6}; double Tax; map Map; string word; void init() { t[0][0] = 9075; t[0][1] = 36900; t[0][2] = 89350; t[0][3] = 186350; t[0][4] = 405100; t[0][5] = 406750; t[0][6] = 500000; t[1][0] = 18150; t[1][1] = 73800; t[1][2] = 148850; t[1][3] = 226850; t[1][4] = 405100; t[1][5] = 457600; t[1][6] = 500000; t[2][0] = 12950; t[2][1] = 49400; t[2][2] = 127550; t[2][3] = 206600; t[2][4] = 405100; t[2][5] = 432200; t[2][6] = 500000; t[3][0] = 9075; t[3][1] = 36900; t[3][2] = 74425; t[3][3] = 113425; t[3][4] = 202550; t[3][5] = 228800; t[3][6] = 500000; Map["Single"] = 0; Map["Marriedjointfiler"] = 1; Map["Survivingspouse"] = 1; Map["Headofhousehold"] = 2; Map["Marriedfilingseparately"] = 3; } int main() { init(); cin.getline (s, 20000); int n = strlen (s); for (int i = 0; i < n; i++) if (s[i] != ' ') word += s[i]; cin >> Tax; int index = Map[word]; if (Tax < t[index][0]) Tax = Tax * rate[0] / 100.00; else { for (int i = 1; i <= 6; i++) if (t[index][i - 1] < Tax && Tax < t[index][i]) { Tax = Tax * rate[i] / 100.00; i = 7; } } Tax = floor (Tax); cout << Tax << '\n'; return 0; }