#include #include #include int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); auto Output = [](long long int i){ std::cout << i << "\n"; }; long long int helloworldNum = 1; for(int i=0; i<26; ++i){ int input; std::cin >> input; switch(i){ case 3: case 4: case 7: case 17: case 22: if(input == 0){ Output(0); return 0; }else{ helloworldNum *= input; } break; case 11: if(input < 3){ Output(0); return 0; }else{ double x=input, diff, d=0.001; do{ //newton diff = (3*x*x-2*(input-2)*x-input+1)/2.0/(-3*x+input-2); x += diff; }while(std::fabs(diff)>d); double tmp = std::round(x); helloworldNum *= tmp*(tmp+1)*(input-tmp-1)/2; } break; case 14: if(input < 2){ Output(0); return 0; }else{ helloworldNum *= std::floor(input/2.0)*std::ceil(input/2.0); } break; } } Output(helloworldNum); return 0; }