Hello,
I am working on an computer program and I am required to find the least possible value of $x$ for
$\lceil \dfrac a x \rceil + \lceil \dfrac b x \rceil + \lceil \dfrac c x \rceil + \lceil \dfrac d x \rceil = H $
where $x,a,b,c,d,H$ are all integers and the values of $a,b,c,d$ and $H$ are given.
I am supposed to find the least possible integral value for $x$ such that the value of $H$ that will be formed (after substituting the values) should be lesser than or equal to the value of $H$ in the question but not greater than $H$.
What I mean by this is that we need to find a minimum possible integral value for $x$ such that after plugging in the values of $a, b...$ the value of $H$ that we get is maximum possible and not greater than the proposed value of $H$ (See the examples for further understanding).
I saw this question on FLOOR function but it was about multiplication and following the method they used to solve it, I got,
$\lceil \dfrac a {n - \alpha} \rceil + \lceil \dfrac b {n - \alpha} \rceil + \lceil \dfrac c {n - \alpha} \rceil + \lceil \dfrac d {n - \alpha} \rceil = H $
where $n$ is the ceil of $x$ and $\alpha$ is the difference of $n$ and $x$. But this method has left me even more clueless on how to go about, since I'm pretty new to ceil and floor functions.
****** EXAMPLES ******
If the values are
$A = 3, B = 5, C = 6, D = 8, H = 6$
then the equation formed will be
$\lceil \dfrac 3 x \rceil + \lceil \dfrac 5 x \rceil + \lceil \dfrac 6 x \rceil + \lceil \dfrac 8 x \rceil = 6 $
for which the correct value for $x$ will be $5$ which is the lowest possible value since, if it is $6$ then the value of $H$ will be $5$ and if the value is $4$, then the value of $H$ will be $7$ which wont comply to the requirements of the value of $H$ and $x$.
But, If the values are
$A = 3, B = 5, C = 6, D = 9, H = 7$
then the equation formed will be
$\lceil \dfrac 3 x \rceil + \lceil \dfrac 5 x \rceil + \lceil \dfrac 6 x \rceil + \lceil \dfrac 9 x \rceil = 7 $
for which the correct integral value for $X$ will be $5$ since if $X = 4$ it would made $H = 8$ (Greater than the given value of $7$) and if $X = 6$ then it would make $H = 5$ (which would be smaller than the value for $x = 5$).
What I thought is that for questions like the second example once we get an fractional value for $x$ (after mathematically solving it) we can floor[ $\lfloor x \rfloor$ ] it.
ANY HELP IS GREATLY APPRECIATED!!! (And if it's not possible to reduce it to an easier equation, a algorithm to computer-solve it is also OK :P )