#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; while(cin>>a>>b>>c>>d>>e>>f){ if(a==0&&b==0&&c==0&&d==0&&e==0&&f==0){ break; } int ans=0; int v1=0,v2=0; ans=d+e+f+((c+3)/4); if(c%4==1){ v1+=7; v2+=5; } if(c%4==2){ v1+=6; v2+=3; } if(c%4==3){ v1+=5; v2+=1; } v2+=5*d; if(v2<b){ ans+=ceil((b-v2)*1.0/9); v1=36*(ans-f)-25*e-16*d-9*c-4*b; } if(v2<b){ ans+=ceil((a-v1)*1.0/36); } cout<<ans<<endl; } return 0; } |
Double click to view unformatted code.