提交时间:2024-01-23 16:35:10
运行 ID: 125219
#include<bits/stdc++.h> #define int long long using namespace std; namespace Fast{ inline long long fr(){ register long long x = 0,f = 1; static char c = getchar(); while (c < '0' || c > '9'){ if (c == '-'){ f = -1; } c = getchar(); } while (c >= '0' && c <= '9'){ x = (x << 1) + (x << 3) + (c ^ 48); c = getchar(); } return x * f; } inline void fw(long long x){ if (x == 0){ putchar('0'); return ; } if (x < 0){ x = -x; putchar('-'); } stack <char> s; while (x){ s.push((x % 10) + 48); x /= 10; } while (!s.empty()){ putchar(s.top()); s.pop(); } } inline void CCF(){ ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); } inline void DEBUG(){ puts("DEBUG"); } } using namespace Fast; signed main(){ int a,b; a = fr(),b = fr(); if (a == 1){ fw(8 + max(0LL,b - 1)); } else{ fw(10 + 2 * max(0LL,b - 1)); } return 0; }