题面:
代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
priority_queue<long long>x;
long long n,a,ans;
while(cin>>a>>n){
ans=a;
for(int i=1;i<n;i++){
x.push(-(2*a+1));
x.push(-(3*a+1));
ans=-x.top();
x.pop();
}cout<<ans<<" ";
}return 0;
}