Solved 12 and 13
merged
optimized problem 14