### Newtech66's blog

By Newtech66, history, 22 months ago,

In newer problems on CodeForces and other sites, I usually see multi-test inputs that say something like "it is guaranteed that sum of $n$ over all testcases does not exceed XXXXX".

I am unable to figure out how to implement such a generator in Polygon. Can someone tell me how exactly I should go about this?

• +11

 » 22 months ago, # | ← Rev. 2 →   +3 1) generate k tests with n = bound / k2) generate one big test and a lot of small tests3) generate tests with n = random(1, bound — sum of generated n) until their sum exceeds bound