题解 | #D博弈与核心能源动力#
D博弈与核心能源动力
https://ac.nowcoder.com/acm/problem/216024
#include<bits/stdc++.h>
using namespace std;
int main ()
{
int m,k,g,p,ans=0,t=0;
cin>>m>>k>>g>>p;
if (m/p>0)t=m/p;
while(k/2||t||g/4){
k+=t;
g+=t;
ans+=t;
t=k/2+g/4;
k=k%2;
g=g%4;
}
cout<<ans;
}