Back to General discussions forum
Simple arithmetic and careful thought are all that is needed here.
Clive, thank you!
Problem is ready - by the way now your data generation code creates 3 test-cases - I suppose that's enough?
Rodion,
Thanks for posting the problem. I decided that 3 test cases were sufficient for this one.
Dear Clive, thank you for clarification!
As it happens, I feel bewildered. While initially I thought "fractional" version is harder, I solved it first, but with the "integer" one... After several attempts I wrote solution which I don't quite understand - and while it passed once, it seemingly fails on some different input sets. Hopefully I can figure out what is wrong in the morn (and perhaps, why and whether it works at all).