The problem didn't say the price must be > 0. So they may all lowered the price to 0 after lunch time, so the price before lunch time can be $5, $7, or $35 in this case...<p>If the price must be > 0, assume the it is `a` cents before lunch, `b` cents after lunch, and farmers sold `x`, `y`, and `z` chickens before lunch, where `a`, `b`, `x`, `y`, `z` are all unsigned integers satisfying:<p><pre><code> ax + b(10-x) = 3500
ay + b(16-y) = 3500
az + b(26-z) = 3500
</code></pre>
Note 10 + 16 - 26 = 0, we can sum the above equations into:<p><pre><code> (a-b)(x + y - z) = 3500
</code></pre>
let c = a - b, we know that c is positive integer (price before lunch is higher than after lunch). There are two obvious facts:<p>1) c is a factor of 3500<p>2) since x + y - z <= 26, c must be >= 3500/26 = 134<p>We also know that 3500/c is integer, with the equations we know 10(b/c), 16(b/c), 26(b/c) are all unsigned integers, so 2b/c is unsigned integer, assume d = 2b/c, we have:<p><pre><code> x = 3500/c - 5d
y = 3500/c - 8d
z = 3500/c - 13d
</code></pre>
Remember that we are investigating the cases of b > 0, so d > 0, so 3500/c >= 13, then we have the fact:<p>3) c <= 3500/13 = 269<p>with 1), 2), 3), c = 140, 175 or 250<p>when c = 140, 3500/c = 25, so d = 1, x = 25 - 5 * 1 = 20 > 10, not valid<p>when c = 175, 3500/c = 20, so d = 1, x = 20 - 5 * 1 = 15 > 10, not valid<p>when c = 250, 3500/c = 14, so d = 1, x, y, z are all valid, we get b = 125, a = 375<p>Answer: the price before lunch is $3.75, after lunch is $1.25