+ 1
4 stones vs 40 kg..??
shopkeeper has 4 stones total weight of 40 kilograms so he can weight any of kilogram between 1 to 40 by adding and subtracting with four stones only . Find the weight of each weight stone using any language c c++ python any??
8 odpowiedzi
+ 2
How do you subtract or divide stones? 🤔 Are you sure there's a solution to this problem?
+ 2
The best solution I found is 27, 9, 3, 1. Allows you to find 34 weights between 1 and 40 kgs
+ 1
Anna Anna I think stones are actually blank spaces which can be filled and with operators in between😀
+ 1
So, I think you need brute force…
You should be able to do that with nested loops at least…
+ 1
Yep like ternary search as I had in mind. But what about multiplication and division?
+ 1
Sorry for multiplication and division it has only addition and sutraction
+ 1
Dear friends, 1,3,9 and 27 is the right answer I checked all the numbers from 1 to 40 by these 4 no.