输入
1 2 10
输出
6
解析:
二分,注意两端端点L、R的取值!!!
#include<bits/stdc++.h>
using namespace std;
#define int long long
int x,y,z;
signed main(){
scanf("%lld%lld%lld",&x,&y,&z);
int l=1,r=1e9;
while(l<r){
int mid=l+r>>1;
if(x*mid+y*((mid-1)/3+1)>=z) r=mid;
else l=mid+1;
}
cout<<l;
return 0;
}