Assume you have problem where there's tree with 100000 vertices and you have to answer 100000 queries of the form (x,y) meaning root the tree at x and then calculate some property for the subtree rooted at y. Assume the problem is easy to solve with tree dp for a fixed root but not obvious how to use tree rerooting dp. You could pick 100 roots and random then pre-calculate the answers and hope for each query in at least one of these rooted trees x is not in the subtree rooted at y. How would you create a test case that has a high probability to break such an approach?







where it has the maximum
mod
is a pain because of fractions. If you try to avoid them by multiplication by denominators things overflow pretty quickly.
and exceeding the time limit. In general if you are given an interval of length
do you want in order to be confident that a square root decomposition will pass the time constraint? Also are there standard limits used in Codeforces deliberately set to prevent square root decomposition based approaches? 