solution: /submissions/accepted/maarten.py
version: 2025-02  # use this version of the generators framework

test_group.yaml:
  # One or more of:
  # case_sensitive
  # space_change_sensitive
  # float_absolute_tolerance eps
  # float_relative_tolerance eps
  # float_tolerance eps
  output_validator_args: ["float_tolerance", "1e-6"]

data:
  sample:
    data:
      # Some small examples showing to help understanding of the problem.
      - '':
          in: |
            3 1000
            80 3
            120 5
            160 4
          ans: "11"
      - '':
          in: |
            2 100
            100 1
            500 2
          ans: "3"
      - '': &sample3
          in: |
            3 7
            1 1
            1 1
            1 1
          ans: "4.3333333"
  secret:
    data:
      - min: &minimal
          in: |
            1 1
            1 1
          ans: "3"
      - first-mill:
          in: |
            2 1
            1 1
            1 2
          ans: "3"
      - second-mill:
          in: |
            2 1
            1 2
            1 1
          ans: "3"
      - both-mills:
          in: |
            2 2
            1 1
            1 1
          ans: "3"
      - half-hour:
          in: |
            2 1
            1 1
            1 1
          ans: "2.5"
      - overflow:
          generate: gen-overflow.py {seed}
          count: 16
      - min-time-1: gen-min-time.py 100000 100000000
      - min-time-2: gen-min-time.py 100000 10000000
      - max-ans-10m: gen-max-ans.py 100000 10000000
      - max-ans-1m: gen-max-ans.py 100000  1000000
      - max-100k: gen-max.py 100000 100000
      - max-1m: gen-max.py 100000  1000000
      - max-10m: gen-max.py 100000 10000000
      - max-100m: gen-max.py 100000 100000000 # kills accepted/mike.cpp
      - max-1g: gen-max.py 100000 1000000000
      - max-3g:
          in: |
            1 1000000000
            1 1000000000
      - max-almost-3g:
          in: |
            1 999999999
            1 1000000000
      - random:
          generate: gen-random.py -n 100000 -w 100000000 --seed {seed}
          count: 3
      - random-small-t:
          generate: gen-random.py -n 100000 -w 100000000 --hi_t 10 --seed {seed}
          count: 3
      - random-small-p:
          generate: gen-random.py -n 100000 -w 100000000 --hi_p 10 --seed {seed}
          count: 3
      - random-small-tp:
          generate: gen-random.py -n 100000 -w 100000000 --hi_t 10 --hi_p 10 --seed {seed}
          count: 3
      - little-wheat-10: gen-random.py -n 10 -w 1 --hi_t 1 --hi_p 1
      - little-wheat-100: gen-random.py -n 100 -w 1 --hi_t 1 --hi_p 1
      - little-wheat-1K: gen-random.py -n 1000 -w 1 --hi_t 1 --hi_p 1
      - little-wheat-10K: gen-random.py -n 10000 -w 1 --hi_t 1 --hi_p 1
      - little-wheat-100K: gen-random.py -n 100000 -w 1 --hi_t 1 --hi_p 1
      - little-wheat-far-mills-10: gen-random.py -n 10 -w 1       --lo_t 100000 --hi_t 100001 --hi_p 10
      - little-wheat-far-mills-100: gen-random.py -n 100 -w 1     --lo_t 100000 --hi_t 100001 --hi_p 10
      - little-wheat-far-mills-1K: gen-random.py -n 1000 -w 1     --lo_t 100000 --hi_t 100001 --hi_p 10
      - little-wheat-far-mills-10K: gen-random.py -n 10000 -w 1   --lo_t 100000 --hi_t 100001 --hi_p 10
      - little-wheat-far-mills-100K: gen-random.py -n 100000 -w 1 --lo_t 100000 --hi_t 100001 --hi_p 10
  invalid_output:
    data:
      just_plain_wrong:
        <<: *minimal
        out: "2"
      too_large:
        <<: *minimal
        out: "3.00001"
      too_small:
        <<: *minimal
        out: "2.99999"
      too_large_float:
        <<: *sample3
        out: "4.33334"
  valid_output:
    data:
      precision-hi:
        <<: *minimal
        out: "3.000001"
      precision-lo:
        <<: *minimal
        out: "2.999999"
