According to the first triangle inequality theorem, the lengths of any two sides of a triangle must add up to more than the length of the third side. In you case 3+4=7. 7 is less than 8.
The better buy would be the 36 bottles of water for 4$ because it would be 9 bottles per dollar other than the 24 which is 8 bottles per every dollar. Hope it helps!