少有人做的水题,直接贴代码。
//poj 3911
//sep9
#include <iostream>
using namespace std;
typedef long long ll; int main()
{ll n,c;while(scanf("%lld%lld",&n,&c)==2){if(n==0){printf("0\n");continue;} ll x=c/(2*n);ll y=x+1; printf("%lld\n",x*(c-n*x)>=y*(c-n*y)?x:y);}return 0;
}