fork download
  1. #include <bits/stdc++.h>
  2. long long complexity(int i, int j, int k, long long ans){
  3. if(!i || !ans)
  4. return 1;
  5. return std::max(complexity(i-1, j, k+1, ans/j), complexity(i-1, j+1, 1, ans/j)*(k+1));
  6. }
  7. int main() {
  8. std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr);
  9. std::cout << complexity(30, 2, 1, LONG_LONG_MAX) * 20 << '\n';
  10. }
Success #stdin #stdout 0.58s 5316KB
stdin
Standard input is empty
stdout
58982400