Cosine Similarity(LintCode 445):

Problem