Problem #315
Rangeela's Madness
There is an infinite 3D space of integer coordinates. Each point is colored by an unknown color, selected out of 666666 options. The cost of an L\times B\times H cuboidal region is (10^{30})\times L + (10^{15})\times B + H. Rangeela wants to buy a cuboidal region that definitely has a cuboid inside it with all its corners having the same color but is lazy enough to not check the grid manually. Compute the values of L, B and H to minimize the cost incurred by Rangeela. Print (L + 2\times B + 3\times H) modulo 1234567891.
Note: L, B, H denote the number of points, not the edges between the points.