The upper limit is included. In your example; 5kl would still be in the lower bracket and only the amount over 5 kl would be the next bracket. If you were given a value of 5,1kl; 5kl is charged at the 0-5kl rate and the remaining 0,1kl would be charged at the next rate.
One would need to work everything backwards. Check how much each level will cost in total: 0-5kl - Free (R200 remaining) = 5kl 5-15kl - R39,90 (R160,10 remaining) = 10kl 15-20kl - R42,55 (R117,55 remaining) = 5kl Now we can still spend R117,55, so we must check how much we can get at the last tariff level. (20-50kl) R117.55/R12.61 = 9,32kl So: 5 + 10 + 5 + 9,32 = 29,32kl can be bought for R200.
The first bracket goes up to 5kl. The second one is from 5kl to 15kl, so would be 10 units in total. Remember that there are decimals, since the kilolitres are 1000 litres, and we could actually record to the nearest litre if we wanted.