@coder don't worry about the big numbers....but try to reduce these numbers as low as possible...and use euler totient...I would recommend using Python for this question
I sometimes like to think of myself as a decent programmer, and there for, might offer some assistance, but I read the problem and don't understand what it is asking you for. If some one could explain it in a more simple form of English, then maybe I could be of more help.
it must be(n-1-i)C(k-1)
the idea here is we neeed to make ith elemnt the rst elemnt of the subsequnce. n-1-i is the numbr of elmnts after ith elmnt .so we choose k-1 elmnts from these n-1-i elements .
similary in the other exp we make our ith elemnt as last elemnt choosing k-1 elements from first i elemnts.
and hence the expressions!!
@ Kr002
ok I follow the undirected graph concept. But now N vertices and M edges. Does this mean you do not no how many vertices and edges there are? Or they can change?
Wait a second... Is this a different problem? What happened to the no min no max problem? I think I am mixing things up in my head.