Problem Link: Feasible relations | Practice Problems
Solution Link: ToMs5N - Online C++0x Compiler & Debugging Tool - Ideone.com
Getting Partial Score.
Getting MLE in 2 test cases and TLE in 1.
Can anyone please help me , how to optimize the code further