F(S,T): counting in 1D, 2D, 3D, 4D and ND
The original Codeforces problem asks for ordered nonnegative triples satisfying a sum bound and a product bound, with inputs up to . Its dimension- form is
Both inequalities include equality. Coordinates are ordered: and count separately. Throughout, are nonnegative integers and for .
[O] shows each dimension; [E] contains five bounded C++17 references; [I] tests the same counts. These examples explain exact arithmetic. They do not implement the fast thesis algorithms.
1D: intersect two bounds
Section titled “1D: intersect two bounds”One coordinate is both the sum and the product:
For , the integers are : four points. Counting the interval takes constant many arithmetic operations. Binary input/output still costs time proportional to its length.
Experiment: 1D: intersect the integer bounds