Codechef Jan 14: Two problems