LTIME18 graph

Problem link-codechef.com/LTIME18/problems/WSCAGAIN

Editorial link-

http://discuss.codechef.com/questions/56876/wscagain-editorial

Solution link-

http://www.codechef.com/viewsolution/5471886

I am not able to get function :nt(int)

Please anyone help.I am not unable to get that…I m struggling from previous 4 days :frowning: