solution: /submissions/accepted/solution.cpp
#solution: /submissions/accepted/submission.py
version: 2025-12  # 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:

data:
  sample:
    data:
      - '':
         in: |
           2
           2002 2004
           2001 2003
      - '':
         in: |
           2
           2001 2001
           2002 2002
      - '':
         in: |
           3
           1999 2003
           1987 2005
           2002 2001

  secret:
    data:
      # You can re-use the input validator by symlinking it as `generator` in
      # this directory. Below is some inspiration for test cases.
      #
      # Use `-X` to set the value of variable `X`, as provided to the `read_*` functions.
      # Use `min` and `max` to set variables to their minimum and maximum
      # allowed values.
      #- min: generator {seed} -n min -k min -ai min
      #- max: generator {seed} -n max -k max -ai max
      # Leave a variable out to pick a uniform random value.
      #- random_a: generator {seed} -n max
      # Provide an explicit list of values:
      #- binary: generator {seed} -ai 0,1
      # Provide probabilities for each value:
      #- mostly_0: generator {seed} -ai 0:0.99,1:0.01
      # Uniform random values in range:
      #- small_a: generator {seed} -n 10 -ai 1..100
      # Use a geometric distribution (see validation.h for more):
      #- geometric: generator {seed} -n 100 -k 123 -ai geometric(0.1)

      # Manual cases can be added like this:
      #- copied:
      #    copy: manual/testcase
      # They should be written to somewhere inside generators/ and will be
      # copied into data/.
      # You can also dump them in data/secret and run `bt generate --add-unlisted`.

      # Typically, small test cases are more likely to find bugs/edge cases.
      # When the limit on n is 1000, do something like:
      #- small: generator {seed} -n 1
      #- small: generator {seed} -n 2
      #- small: generator {seed} -n 3
      #- small: generator {seed} -n 7
      #- small: generator {seed} -n 13
      #- medium: generator {seed} -n 85
      #- medium: generator {seed} -n 103
      #- medium: generator {seed} -n 243
      #- large: generator {seed} -n 991
      #- large: generator {seed} -n 999
      - minimal: { in: "1\n1 1\n"  }
      - minimal: { in: "1\n1 1000000000\n" }
      - minimal: { in: "1\n1000000000 1\n" }
      - extremal-year:
          in: |
            3
            1000000000 2
            1 4242
            42 42
      - rand-small:
          generate: rand.py {seed} 8
          count: 10
      - rand-medium:
          generate: rand.py {seed} 300
          count: 10
      - all-correct: all-correct.py {seed} 3000
      - rand-large:
          generate: rand.py {seed} 2999
          count: 3
      - rand-large:
          generate: rand.py {seed} 3000
          count: 10

      - nested: nested --seed {seed} --n 3000
      - nested: nested --seed {seed} --n 3000 --lrshuffle
      - comb: comb --seed {seed} --n 3000
      - comb: comb --seed {seed} --n 3000 --lrshuffle
      - weird-tree:
          generate: weirdtree --seed {seed} --n {count}
          count: [1311, 2999, 3000]
      - weird-tree:
          generate: weirdtree --seed {seed} --n {count} --lrshuffle
          count: [1311, 2510, 2713, 2999, 3000]

      - all-small: all-small --min 1 --max 3
      - all-small: all-small --min 4 --max 4
      - all-small: all-small --min 5 --max 5

      # The following 3 tests are included as files to save 1h on generation time.
      # - specific-answer: specificanswer --ans 0
      # - specific-answer: specificanswer --ans 1
      # - specific-answer: specificanswer --ans 998244352
      - specific-answer-0: { copy: manual/specific-answer-0 }
      - specific-answer-1: { copy: manual/specific-answer-1 }
      - specific-answer-minus1: { copy: manual/specific-answer-minus1 }

      # Many testcases with the same parameter can be generated like this:
      #- large:
      #    generate: generator {seed:1} -n 1000
      #    count: 10

  invalid_input:
    # Add invalid test cases to ensure that input_validators correctly rejects them.
    data: []
      #invalid_test_case_input:
      #  in: "<invalid input>"

  invalid_answer:
    # Add valid test cases with invalid answers to ensure that the answer_validators correctly rejects them.
    # (The output validator is also called with these)
    data: []
      #invalid_test_case_answer:
      #  in: "<valid input>"
      #  ans: "<invalid answer>"

  invalid_output:
    # Add valid test cases with answer and invalid team output to ensure that the output_validator correctly rejects them.
    data: []
      #invalid_test_case_output:
      #    in: "<valid input>"
      #    ans: "<valid answer>"
      #    out: "<invalid output>"

  valid_output:
    # Add valid test cases with answer and team output to ensure that the output_validator correctly accepts them.
    data: []
      #valid_test_case_output:
      #    in: "<valid input>"
      #    ans: "<valid answer>"
      #    out: "<valid output>"
