Solved 12th after implementing some wrong math at first :)