One has to check if N%3 is 0, 1 or 2. If 0, print DP, else if 2, print Graph Theory, else print Binary Search.
One has to be careful with what data type is being used as N will overflow integer limit.