Regarding this submission, it gives the desired result when I run the tests on my machine (I'm using the same Rust version 1.42.0). Although, as you can see, it gives a different output when Codeforces execute it's tests.
Any idea?
Thanks in advance.