public void process() {
    for (int i = 1; i <= invest; i++) {
      for (int j = 0; j < corp; j++) {
        for (int k = 0; k <= j; k++)
          if (temp[j - k][i - 1] + investTable[k][i] > temp[j][i]) {
            temp[j][i] = temp[j - k][i - 1] + investTable[k][i];
            bestProfitTable[j][i] = k;
          }
      }
    }
  }