<commit_before>#include <iostream>
#include <cmath>

#define MAX_CARD_NUM 280

using namespace std;

int main() {
  float l;

  while (cin >> l) {
    if (l == 0.00)
      break;

    float acc = 0.0, prev = 0.0;
    for (int i = 2; i <= MAX_CARD_NUM; i++) {
      acc += 1.0 / i;

      if (acc >= l && prev < l) {
        cout << i - ceil(acc - l) << " card(s)" << endl; 
        acc = 0.0;
        prev = 0.0;
        break;
      }

      prev = acc;
    }
  }
}<commit_msg>optimise the space complexity<commit_after>#include <iostream>

#define MAX_CARD_NUM 280

using namespace std;

int main() {
  float l;

  while (cin >> l) {
    if (l == 0.00)
      break;

    float acc = 0.0;
    for (int i = 2; i <= MAX_CARD_NUM; i++) {
      acc += 1.0 / i;

      if (acc > l) {
        cout << i - 1 << " card(s)" << endl; 
        acc = 0.0;
        break;
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.16837315130830488, 'fraction_numerical': 0.03526734926052332, 'mean_word_length': 1.6426426426426426, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2081500', 'n_tokens_mistral': 378, 'n_tokens_neox': 345, 'n_words': 100}