add qnikst`s solution

Sorry that all patches are in the same pull request, in this commit there are 2 new solutions, 
fix for output, and one new test, that some of the solutions fail.