Click here to read the complete problem statement.
is there any use of the first criteria ?? cz I solved it without that