http://www.codechef.com/problems/RDF/